In few places its been mentioned that .pbxproj file should be committed/imported as binary in cvs or git. it looks like script file in text format. what are reasons behind this suggestion that it should be treated as binary?
Asked
Active
Viewed 1,041 times
1 Answers
3
As mentioned here, pbxproj is not really mergeable, being a complex property list managed as JSON.
The usual setting is in a .gitattributes
:
*.pbxproj -crlf -diff -merge
As explained here:
This prevents Git from trying to fix newlines, show it in diffs, and excludes it from merges.
The other approach is:
*.pbxproj binary merge=union
As documented here, this didn't work well.
The problem was that braces would become out of place on a regular basis, which made the files unreadable. It is true that tho does work most of the time - but fails maybe 1 out of 4 times.
-
On merge=union: http://haacked.com/archive/2014/04/16/csproj-merge-conflicts/ and http://stackoverflow.com/a/36833404/6309 – VonC Apr 25 '16 at 06:42
-
thanks VonC for answer and link.. what is the issue in just treating project files as binary without merge=union feature? – nav1729 Apr 27 '16 at 08:49
-
@nav1729 that should work too, as long as git does not try to merge it. – VonC Apr 27 '16 at 09:12
-
does this mean git merges files flagged as binary? – nav1729 May 04 '16 at 03:39
-
1@nav1729 yes, it does mean binary for those files. Or binary-like (no diff, no merge) – VonC May 04 '16 at 04:32
-
Any issues with the first solution ? – thibaut noah Jun 17 '19 at 12:32
-
@thibautnoah If by "first solution", you mean (3 years later) `*.pbxproj -crlf -diff -merge`, then the only issue is that those files are no longer merged. If you do modify them in one branch, you need to report said modification in the other branch. – VonC Jun 17 '19 at 22:10