# Source format of node-red project

**URL:** <https://discourse.nodered.org/t/source-format-of-node-red-project/33214>\
**Category:** Share Your Projects\
**Created:** [23 September 2020 07:26 UTC](https://discourse.nodered.org/t/source-format-of-node-red-project/33214 "2020-09-23T07:26:39Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![sys4cad](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sys4cad/32/28980_2.png) [@sys4cad](https://discourse.nodered.org/u/sys4cad)\
**Post date:** [23 September 2020 07:26 UTC](https://discourse.nodered.org/t/source-format-of-node-red-project/33214/1 "2020-09-23T07:26:40Z")

</div>

**saving node-red project with gitlab**  
currently node-red project is saved w/ one-line json string and it makes me hard to identify changed item using any of git client.  
Is there anyway to save source as pretty json format ( w/ new line )?

[nodered-prj-gitlab\_|690x453](https://discourse.nodered.org/uploads/short-url/bVY22uJG1a6fl4b5Qer4Pck3Dr6.png)

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [23 September 2020 07:27 UTC](https://discourse.nodered.org/t/source-format-of-node-red-project/33214/2 "2020-09-23T07:27:34Z")

</div>

Hi @sys4cad

yes, have a look for the `flowFilePretty` option in your settings file.

---

<div class="post-metadata">

**Author:** ![sys4cad](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sys4cad/32/28980_2.png) [@sys4cad](https://discourse.nodered.org/u/sys4cad)\
**Post date:** [23 September 2020 07:36 UTC](https://discourse.nodered.org/t/source-format-of-node-red-project/33214/3 "2020-09-23T07:36:26Z")

</div>

@knolleary thanks for your response.  
Could you kindly pinpoint where can I find settings file?  
I'm currently using nodered/node-red docker container.

---

<div class="post-metadata">

**Author:** ![sys4cad](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sys4cad/32/28980_2.png) [@sys4cad](https://discourse.nodered.org/u/sys4cad)\
**Post date:** [23 September 2020 07:41 UTC](https://discourse.nodered.org/t/source-format-of-node-red-project/33214/4 "2020-09-23T07:41:46Z")

</div>

./usr/src/node-red/node\_modules/node-red/settings.js  
//flowFilePretty: true,

./usr/src/node-red/node\_modules/@node-red/runtime/lib/api/settings.js  
if (runtime.settings.flowFilePretty) {  
safeSettings.flowFilePretty = runtime.settings.flowFilePretty;

I found 2 candidates. 🙂

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [23 September 2020 07:42 UTC](https://discourse.nodered.org/t/source-format-of-node-red-project/33214/5 "2020-09-23T07:42:20Z")

</div>

The settings file is in `/data` within the container. We recommend you mount that as an external volume so you are able to update the container without losing your flows/settings - [https://nodered.org/docs/getting-started/docker#managing-user-data](https://nodered.org/docs/getting-started/docker#managing-user-data)

---

<div class="post-metadata">

**Author:** ![sys4cad](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sys4cad/32/28980_2.png) [@sys4cad](https://discourse.nodered.org/u/sys4cad)\
**Post date:** [23 September 2020 07:44 UTC](https://discourse.nodered.org/t/source-format-of-node-red-project/33214/6 "2020-09-23T07:44:48Z")

</div>

Thanks a million!

---

<div class="post-metadata">

**Author:** ![sys4cad](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sys4cad/32/28980_2.png) [@sys4cad](https://discourse.nodered.org/u/sys4cad)\
**Post date:** [23 September 2020 08:05 UTC](https://discourse.nodered.org/t/source-format-of-node-red-project/33214/7 "2020-09-23T08:05:53Z")

</div>

I've changed settings.js file in /data

// To enabled pretty-printing of the flow within the flow file, set the following // property to true: flowFilePretty: true,

and restarted the container, but saved flow in git still one line.  
did I miss something?

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [23 September 2020 08:17 UTC](https://discourse.nodered.org/t/source-format-of-node-red-project/33214/8 "2020-09-23T08:17:34Z")

</div>

Have you done a deploy since restarting?

---

<div class="post-metadata">

**Author:** ![sys4cad](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sys4cad/32/28980_2.png) [@sys4cad](https://discourse.nodered.org/u/sys4cad)\
**Post date:** [23 September 2020 08:32 UTC](https://discourse.nodered.org/t/source-format-of-node-red-project/33214/9 "2020-09-23T08:32:31Z")

</div>

greatly appreciated! it works now.  
 ![prettyJsonWorks](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/7/07128763b67ddddef8eaf94fc42a1b7b17d551a7.png)

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [23 September 2020 08:49 UTC](https://discourse.nodered.org/t/source-format-of-node-red-project/33214/10 "2020-09-23T08:49:27Z")

</div>

You might also like to see post 5 of [this thread](https://discourse.nodered.org/t/which-files-need-version-control/33201/5) which coincidentally I posted only a few minutes ago which shows how you can also get a file with function nodes one line/line, which is useful for viewing diffs.

---

<div class="post-metadata">

**Author:** ![sys4cad](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sys4cad/32/28980_2.png) [@sys4cad](https://discourse.nodered.org/u/sys4cad)\
**Post date:** [24 September 2020 03:58 UTC](https://discourse.nodered.org/t/source-format-of-node-red-project/33214/11 "2020-09-24T03:58:05Z")

</div>

thanks a lot.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [22 November 2020 07:26 UTC](https://discourse.nodered.org/t/source-format-of-node-red-project/33214/12 "2020-11-22T07:26:47Z")

</div>

This topic was automatically closed after 60 days. New replies are no longer allowed.
