Xcode Project file git merge conflict

前端 未结 8 1427
萌比男神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:57

    When this is caused by adding files from two or more collaborators/branches (which in my experience has always been the case to date and can be checked by looking at the diff) I do this:

    1. Resolve the conflict by "use ours" or "use theirs" (whichever has added the most files).
    2. Commit (this produces a repo that contains all the added files but some are not in the project).
    3. Within Xcode use "Add Files To..." to add the missing files from the other collaborator/branch (they are easy to find as they are in the project directory and Xcode usefully highlights them for you).
    4. Commit.

    (I am not convinced step 2 is really necessary - but feels neater to me).

提交回复
热议问题