How to resolve merge conflicts in sourceTree

I have a develop branch that I just committed files to. During the commit I got a pop-up that said there were merge conflict due to an earlier commit by another developer. Instructions in the pop-up said to go to 'Resolve Conflicts' and use those options. The only options I am given under Resolve Conflicts are 'Restart Merge' or 'Mark Unresolved' neither of which is an acceptable solution. How do i actually resolve merge conflicts?

2 answers

You can resolve merge conflicts manually by opening the conflicted files in any editor.  The conflicts have been marked up like this:

<<<<<<< HEAD
// code from base branch
=======
// code from merged branch
>>>>>>> branch1

You can then manually edit the code to contain one or the other or a synthesis of both changes and remove the markups.  Then stage and commit to complete the merge. 

 

You have to configure SourceTree to use your merge software. In the Diff tab of the Options dialog, look for the Merge tool dropdown for a list of programs that SourceTree knows how to use out of the box.

Suggest an answer

Log in or Join to answer
Community showcase
Brian Ganninger
Published Jan 23, 2018 in Sourcetree

Tip from the team: workflow and keyboard shortcuts

Supported Platforms macOS Sourcetree has a lot to offer and, like many developer tools, finding and using it all can be a challenge, especially for a new user. Everyone might not love ...

262 views 0 3
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot