Merging issues with Git Xcode 9

I have a master branch, from which an integration branch, from which a dev branch. I do my work on the dev branch, committing and pushing as normal. To merge into integration, I use the Source Control navigation panel, right click on Integration and select merge dev into integration. It then pulls up a whole list of merge conflicts which amounts to every file I've changed in dev. No one else is making any changes to integration.

So merge fails and integration is now checked out. I right click on dev and select merge into integration. That usually works ok. Sometimes not and then I'm flummoxed. Often, it tells me the xcworkspace can't be found and do I want to cancel or save the xcode one. Cancel leaves me with nothing - no ability to change the project and I need to start pulling from one of the other branches and then I end up with a merge conflict; saving the xcode ones now means there is a merge conflict with that file which I can't resolve and I need to resort to the command line or Github.


Am I doing something wrong or is it right to expect that with a checked out dev branch, 'merge dev into integration' should work? What with creating 12 github profiles in preferences, merge issues and not pushing tags it feels like this integration is a right mess. It was better in xcode8 where there was a mix of xcode and command line use for git usage/github integration.

Replies

I was having the same problem and found a solution that worked for me in Xcode 9.2

Here are the steps I took (following your branch names)

1 - Commit and push the dev branch as you were doing before.

2 - Check out the "integration" branch, so everything is going to be loaded from integration branch again, and "integration" should be marked as (current).

3 - Now merge dev branch into integration branch

4 - Now that you merged, don't forget to push. I took a look at github after i merged, and the files don't show up there until you "push" again.

When I did things this way, Xcode did not show any merge conflicts from the new files, and they were added to the project navigator automatically.

It is a bit counter-intuitive, I agree, but it worked for me.