Xcode Project file git merge conflict

前端 未结 8 1421
萌比男神i
萌比男神i 2021-01-31 03:28

In Xcode, what\'s the best way to avoid Git conflict in the project file? (I am in manual git, not using Xcode interface for git)

I\'ve cloned mapbox-ios-sdk from Github

8条回答
  •  清酒与你
    2021-01-31 03:43

    .pbxproj will change when you add new files to the project. There will be conflicts if two or more collaborators add files at the same time (without getting one another's changes first). We are avoiding this in my project by following these steps before and after adding new files:

    1. Before adding a file, commit your changes, then pull from the master so that you have the latest.If someone has added a file, you now have the latest .pbxproj
    2. Add your file(s).
    3. Immediately commit and push your changes up to the master (hopefully, before another collaborator has added another file).

    It's wimpy, but we don't relish manually resolving .pbxproj conflicts.

    Also, see this Stack Overflow question with excellent responses: How to use Git properly with XCode?

提交回复
热议问题