Search code examples
iosxcodegitmacoscvs

why should .pbxproj file be treated as binary in version control systems?


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?


Solution

  • 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.