Xcode Project file git merge conflict

前端 未结 8 1431
萌比男神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 04:01

    In most case, you can fix the merge by following code, remove the lines which git adds:

    #!/bin/bash
    FILE={PRODUCT_NAME}.xcodeproj/project.pbxproj
    sed '/======/d' $FILE | sed '/<<<<>>>>/d' > temp
    cat temp > $FILE
    rm temp
    

    but if you rename the group of your project and it leads to conflicts, you will manually delete the extra lines of your original group.

提交回复
热议问题