Xcode 8 source control does not show conflicts
After Xcode has updated to version 8.0 (8A218a), I have a problem pulling changes from git repository from Xcode only when some files are conflicted. We are all working on the same branch.
As long as there are no conflicts, everything works perfectly and I am able to commit, pull and push.
But I figured out that whenever we have a conflict in some of the files, Xcode is not showing conflicts anymore. It just closes the pull popup window without showing the conflict resolver window. No info or anything. I don't see the
Pull successful
message. And I can't push my commit (because changes are not pulled) getting the message:
Make sure all changes have been pulled from the remote repository and try again
I have tried pulling using terminal, but the conflicted file gets messed up with git messages showing mine and other people changes in the same conflicted file along those git messages. And the files that other people were working on are now shown as my own changes/additions.
I also tried updating git to the newest version, which is currently 2.10.0. No luck either.
So I end up deleting my copy and cloning the latest one and reapplying changes that i've made which is very annoying.
Does anyone have a solution for this?
EDIT: Here is what you can do as a workaround using the terminal:
-
Open terminal and tell the system where Xcode utilities live:
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
-
Set "opendiff" as the default mergetool globally:
git config --global merge.tool opendiff
-
Open Xcode mergetool manually and get rid of the conflict the usual way:
git mergetool
Save changes, commit, push.
I use git in Terminal to solve this problem, mergetool is used. Fisrt, I pull some changes, but oops, not up to date:
git fetch origin
git pull origin master
From ssh://[email protected]:22/projectname
* branch master -> FETCH_HEAD
Updating a030c3a..ee25213
error: Entry 'filename.c' not uptodate. Cannot merge.
So get up-to-date and try again, but have a conflict:
git add filename.c
git commit -m "made some wild and crazy changes"
git pull origin master
From ssh://[email protected]:22/projectname
* branch master -> FETCH_HEAD
Auto-merging filename.c
CONFLICT (content): Merge conflict in filename.c
Automatic merge failed; fix conflicts and then commit the result.
So I decide to take a look at the changes:
git mergetool
use mergetool to merge the conflict
changes...no...their changes...
git checkout --ours filename.c
git checkout --theirs filename.c
git add filename.c
git commit -m "using theirs"
And then we try a final time
git pull origin master
From ssh://[email protected]:22/projectname
* branch master -> FETCH_HEAD
Already up-to-date.
answer from:How to resolve merge conflicts in Git?
The following sequence of actions resolves this problem:
Exit Xcode
Open Terminal and cd to the project's folder
git checkout -- .
git pull
Look at the output of the pull command. It should announce that there is a conflict in one of the files. Open this file in an external editor (not Xcode). The file should now contain special markers describing the conflict (they were added by GIT) The markers look like this:
<<<<<<< HEAD:file.txt
Hello world
=======
Goodbye
>>>>>>> 77976da35a11db4580b80ae27e8d65caf5208086:file.txt
Delete the markers and resolve the conflict
git add [file name]
git commit -m "conflict in [file name] resolved"
git push
Please update to Xcode 8.2.1
I had the same problem.But it is resolved once I have updated my Xcode version to 8.2.1.
I have resolved all the conflicts today,which I was facing with Xcode Version 8.1.