Branch graph show wrong info after merge
Asked by lang qiu:

After merge, the master branch shows a graph I did not understand at all.

So I was at commit id **4255f88** , the other guy merged my code and proceeded to commit id **647b2fd** , then I merged his 647b2fd and get **c3193e1** . But the branch tree did not show the graph I expected (as I pointed here), instead it shows my latest commit id **c3193e1** is merged from that purple one, which I have no idea at all where does it come from?!

BTW, here I chose "create a commit even fast-forward", but I had tried fast-forward either and got the same result.

CloudPhone__Git_.png  
[](https://community.atlassian.com/t5/Sourcetree-questions/Branch-graph-show-wrong-info-after-merge/qaq-p/218853?attachment-id=253){#link_116a4883a573b5}  
[](/tnckb94959/attachments/tnckb94959/sourcetree-questions/6441/1/CloudPhone__Git_.png){#display_116a4883a573b5_0}


Answers:
author: Bal?zs Szakm?ry
body: What it actually shows is that you have an unfinished merge (your uncommitted changes have two parents) between master and wp. Either finish or abort this merge before doing anything else.

comments: author: Bal?zs Szakm?ry
body: Your screenshot shows that your last commit is c3193e1 (it is pushed) and that you are in the middle of an unfinished merge.


author: Bal?zs Szakm?ry
body: You do have uncommitted changes (the top line in the screenshot, with the empty grey circle on the left in the graph and "\*" in the Commit column), which have two parents (the two grey lines coming from the empty circle). This means that you are in the middle of a merge.You can use the "Reset All" Option in the Discard dialog to abort the merge.


author: lang qiu
body: I stash the only 2 files remained (They never caused the problem before) The branch tree still looks weird. I do not have uncommitted change now but it still shows that purple line, which I have no idea where does it come from!

CloudPhone__Git_.png

[](https://community.atlassian.com/t5/Sourcetree-questions/Branch-graph-show-wrong-info-after-merge/qaq-p/218853?attachment-id=5192){#link_116a489a615c56}  
[](/tnckb94959/attachments/tnckb94959/sourcetree-questions/6445/1/CloudPhone__Git_.png){#display_116a489a615c56_0}


author: Bal?zs Szakm?ry
body: The highlighted commit is a merge, so it has two parents. (Why did you merge a commit instead of a branch?)You might want to read this: <http://git-scm.com/docs/git-merge> to understand what is going on.


author: lang qiu
body: I just clicked merge button and sourcetree popped up a dialog said "Pick a commit to merge into your current branch". This is what I always do when I merged others' codes and I nerve had a problem before till now. I just want to get rid of that purple line and let my latest commit shows it came from 647b2fd. What can I do now ?


author: Bal?zs Szakm?ry
body: Since your changes are already pushed to the server (imac/master is at the same commit), just leave it like this.


author: Seth
body: I've seen this before as well. Occasionally when I merge a branch into my own (I merge branches, not commits), SourceTree draws the graph such that the merge parent is some commit in the distant past that I can't find rather than the recent commit that is the head of the branch I merged.

I haven't been able to figure out how to consistently reproduce this or whether it's a bug in SourceTree or Git. It doesn't really have any impact on my workflow, so I just ignore it. If you want to file a bug - jira.atlassian.com.

As Balazs said, you've already pushed to origin, so there's not much you can do to fix it at this point.

comments: author: lang qiu
body: Your words remind me that it may be a bug in SourceTree, so I checked my colleague's SourceTree to see if things show differently there. To my surprise it did and it shows what I expected!

git merge.png  
[](https://community.atlassian.com/t5/Sourcetree-questions/Branch-graph-show-wrong-info-after-merge/qaq-p/218853?attachment-id=2814){#link_116a48b47594a7}  
[](/tnckb94959/attachments/tnckb94959/sourcetree-questions/6450/1/git%20merge.png){#display_116a48b47594a7_0}


Tags: branch

git

merge