Git and pbxproj

后端 未结 4 728
死守一世寂寞
死守一世寂寞 2020-11-29 21:36

I was looking at an open source Mac application, and they gave some suggested values for .gitignore. They were what I would expect...

However, they also suggested an

4条回答
  •  隐瞒了意图╮
    2020-11-29 22:33

    I faced the problem of corruption *.pbxproj file after resolving merge conflicts manually. Or, more often, my files just 'disappeared' from the working tree after the merge. It drove me mad because we work in a team, so you can imagine how messy it can become very fast.

    So, I have tested merge=union and it works well so far. I know that it can't help if files were deleted or renamed at the same time, but for adding new files it works as expected: there is no conflicts and files don't disappear after the merge. And it also saves quite a bit of time.

    If you want to try it out, here is what I did.

    1) Create a global .gitattributes file. Run in terminal:

    touch ~/.gitattributes
    git config --global core.attributesfile ~/.gitattributes
    

    2) This command should open it in a text editor:

    open ~/.gitattributes
    

    3) When the file opens, add this line and save the file:

    *.pbxproj binary merge=union
    

    Done. Hope this will help new readers like it helped me.

提交回复
热议问题