Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

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

9 votes
Tim Crall
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 08, 2015

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. 


Like # people like this
Like # people like this

I agree with nick t, that is no way to resolve conflicts.

Like # people like this

Like "start walking West" to reach California, this is *a* way, but it would not be my first choice.

Like # people like this

Not only does this seem like a clunky fix at best, it doesn't work.  I edit the file, and it just gives me the merge error again.

Sourcetree seems to not care about merge conflicts. I know how to resolve conflicts by editing files. But isn't Sourcetree supposed to be better than this? There seems to be no interface for it.

Like micsun-al likes this
7 votes
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 08, 2015

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.

I don't understand where to see conflicts and what files need resolution etc. It's so confusing. Where do I click after I hit merge and get the dialog popping up saying to do so? Literally lost.

Like # people like this

The popup dialog after the merge leaves you in the middle of nowhere. It's not clear where to find the Options dialog.

After reading all the comments here and clicking around in the tool, I finally figured out a reasonable way to do this. Please note that this describes how I did it; it may look different for you:

  1. If you haven't set up an external merge tool:
    1. On the main menu, click on Tools -> Options to open the Options dialog
    2. On the Diff tab, in the External Diff / Merge frame, in the Merge Tool dropdown, select one of the available tools. If your tool is not listed, select Custom. In this case, you need to provide the correct arguments for your tool based on the cryptic note provided. I gather you need to surround each argument in quotes, and escape the quotes with backslashes.
    3. Click OK to close the Options dialog.
  2. In Sourcetree, after dismissing the popup that tells you that you have conflicts, click on the "Uncommited Changes" row of the tree.
  3. On the list of Unstaged files at the bottom, you'll find some that have an orange triangle icon with an exclamation sign in it. These are the files with conflicts. (Note that they are also listed in Staged Files, but they show no differences there.)
  4. Right-click on a conflicted file, and select Resolve Conflicts -> Launch External Merge Tool (of course, you could select one of the other options if it's that clear-cut).
  5. If you're lucky enough that your tool is launched correctly, perform your changes.
  6. Once you've performed the merge, save the file and close the external tool.
  7. Then you'll be able to commit your changes. In my case, they were already staged.

If you don't have a merge tool, you'll need to edit the files as explained below by Tim Crall.

Like # people like this

exactly what i needed. thank you for adding

Friend, what software are you using to diff externally? have indication

I use WinMerge, but there are other tools that would work as well.

Suggest an answer

Log in or Sign up to answer
AUG Leaders

Atlassian Community Events