Search code examples
xcodegitmergegit-merge-conflict

Ios git merge conflict in xCode


I have two branches in my project, one is develop and other is master, accidently without merging develop into master I made app live and now I have two different versions on two different branches. Let's say 1.5 version on master and 1.6 on develop, now when I tried to merge these two branches git show merge conflicts in 3 different files,

  • .plist
  • .xcodeproj
  • .xcworkspace

after merge when I tried to open xCode project, it failed and show error "project cannot be load.." when tried to open files manually it just doesn't open in editText. I tried sublime editor but then again I couldn't locate conflict as there were a lot of lines of code.


Solution

  • If you want to replace master content with dev, you should:

    • do a merge from master to dev, keeping dev content
    • then do a trivial merge from dev to master

    That is:

     git checkout dev
     git merge --ours master
     git checkout master
     git merge dev