You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create two git branches for one Node-RED project and try to merge one big file flows.json from that different branches. Please note that this is not reproducing if flows.json file is small.
What happens?
Git does not try to merge files into one, just replacing one file with another.
I even know why that happens. It is because Node-RED save flows.json to git as one string without any formatting: EOL and any other delimiters. Just adding one EOF. I understand, that It is right for Node-RED to save JSON in compact view. But this creates a problem to git compatibility. Could you please provide an option (maybe managed through settings.js, for example) to save flows.json in formatted view for git?
What do you expect to happen?
git should see changed lines (like the "diff" tool) from different branches.
Please tell us about your environment:
[ ] Node-RED version: 1.0.2
Reproduce in any other environment.
Are you referring to the Node-RED Projects feature with its build-in git handling? Or just managing flows files with git in general?
In your settings file there is a setting called flowFilePretty which you can enable and set to true to cause it to format the flow file over multiple lines.
I thought the Projects feature auto-enabled this feature regardless.
It happens when two different people work on the same Node-RED project using git as their code-repository for flows.json. Each person uses their git branch and would like to make merge when both shall finished.
Thank you very much for the hint about flowFilePretty. I've try to find any option like that in the site's documentation, but found nothing. Maybe because the description is ambiguous and incomplete.
I thought the Projects feature auto-enabled this feature regardless.
Checking the code, I was wrong - Projects doesn't auto-enable the feature, although that is something that has been discussed, just never put into action.
Maybe making Node-Red to store separate files, at least for each flow, would make git management easier when doing merges between branches.
Currently it is very easy to create merge conflicts.
What do you think?
Activity
[-]Git merge join impossible for flows.json[/-][+]Git merge join impossible for big flows.json[/+][-]Git merge join impossible for big flows.json[/-][+]Git merge impossible for big flows.json[/+]knolleary commentedon Mar 23, 2020
Are you referring to the Node-RED Projects feature with its build-in git handling? Or just managing flows files with git in general?
In your settings file there is a setting called
flowFilePrettywhich you can enable and set totrueto cause it to format the flow file over multiple lines.I thought the Projects feature auto-enabled this feature regardless.
eitijupaenoithoowohd commentedon Mar 23, 2020
It happens when two different people work on the same Node-RED project using git as their code-repository for flows.json. Each person uses their git branch and would like to make merge when both shall finished.
Thank you very much for the hint about flowFilePretty. I've try to find any option like that in the site's documentation, but found nothing. Maybe because the description is ambiguous and incomplete.
Unfortunately, this is not the case.
knolleary commentedon Mar 23, 2020
Checking the code, I was wrong - Projects doesn't auto-enable the feature, although that is something that has been discussed, just never put into action.
So, for your issue,
flowFilePrettyis the answer.eitijupaenoithoowohd commentedon Mar 23, 2020
Thank you, Nick.
gmag11 commentedon Apr 8, 2024
Maybe making Node-Red to store separate files, at least for each flow, would make git management easier when doing merges between branches.
Currently it is very easy to create merge conflicts.
What do you think?
beasteers commentedon Sep 10, 2024
going further, using either yaml or (even safer) separate files for function code would let you do merges in multi-line strings.
Using separate files for functions could let you just transparently resolve merge conflicts in the code editor.
PaulWieland commentedon Nov 11, 2025
I think this is a feature necessary for deploying NR in corporate environments where there are multiple contributors and larger and larger flow files.
I think splitting the
flows.jsoninto one pretty file per tab would be a great start.