The big problem is that the entire node-red runtime flow is defined in a single JSON text file. As you have already found out, merging text changes is not as straight-forward for text as it is for structured lines of code...
The "Projects" feature at least allows your team members to commit versions of the entire flow, which replace the previous version. If you weren't having problems with git, that would be a way to go. Node-RED uses whatever "git" command/system is installed on the host machine, so if you can clone a repo from the command line, it should work inside node-red also. Are there any git-related errors in the logs?
Assuming you do not want to use the built-in Projects, here are some ideas to make managing changes easier. Some tools like Beyond Compare make merging easier by showing the lines side-by-side. If you have not already done so, make sure to enable this section in your
// To enabled pretty-printing of the flow within the flow file, set the following
// property to true:
This only applies to the JSON structure of your flows, not the code within your
function nodes, and so will not help with merging changes to that code.
There is also a contributed storage solution that converts your JSON flow to YAML before saving it to disk. Since the YAML format is a superset of JSON, it can also retain your newlines (which are not valid in JSON) -- meaning that function code will be easier to merge/compare.