This is in regards to merge XCode project.pbxproj files, but the same principle applies to any database style plain text files (its not a binary file!)
Say that in branch A we have added a file foo.m and in branch B we have bar.m
D814C04514DF6C3100D2AA5D /* foo.m */,
D8DAC57814DF8979004E1309 /* bar.m */,
The correct merge would be to have both lines in the output. However, as these two lines are very similar (by character), Git assumes that they are the same line and tries to merge the two.
However, if there was someway to make Git match only by token, then the two lines would be completely different, and so Git would have both files
I’m hoping there is something I can put in the .gitattributes file to force this behaviour
Also forcing only one user to modify the project file is not really an option. Most work (especially at the start of the project) involves creating new classes, so forcing developers to take turns would greatly reduce development time. Its currently better to take the time to manually merge the project file, than to take turns modifying the project file.
If it’s the same line in both files, it will be a conflict. Git will not merge that.