Master branch split into two branches in Sourcetree
Asked by Dave Newman:

We had 2 developers pushing to the master branch during a publish session recently. The original master branch looked like this:

--Cx--C0

Dev #1 pushed a commit with labels to origin(C1), then Dev #2 pushed 2 commits with labels to origin(C2 and C3), using rebase. This worked, but it created 2 additional "orphan" commits on a side branch - the labels were still attached to the orphans, as follows:

--Cx--C0--C1+labels--C2--C3 (master)  
\\--C2+labels--C3+labels (orphan)

Ugh.

To remedy this dev #2 deleted the labels (from local and origin) and reapplied them to the commits in the master branch. No big deal, now we have this:

--C0--C1+labels--C2+labels--C3+labels (master)

Meanwhile, Dev #1 pushed another commit to origin, C4 (no labels). Dev #2 pulled this commit and the "source tree" was split asunder -- we now have what appears to be 2 separate branches, like this:

--C3+labels--C4 (master)  
--Cx--C0--C1+labels--C2+labels (orphan)

Note there are apparently NO preceding commits to what is now labeled "master" in the tree view. All previous commits are now in the "orphan" branch.

After a moment of panic, we realized the repo was fine, just the display was broken. Git log shows everything where it should be, as does GitKraken (Dev #3) -- and so does Sourcetree, but only if we switch it from "All Branches" mode to "Current Branch" mode. When we switch back to All Branches mode it appears to be broken again.

I have no idea if the steps we followed contributed to the confusion, so I included them just in case. This is obviously a Sourcetree bug, not a git issue. Can we get this fixed please?

Thanks,  
Dave Newman


Answers:
author: Manju
body: Merging the orphan branch to master might resolve this discrepancy. Have you tried it?

comments: author: Dave Newman
body: That doesn't work - there is nothing to merge. The master branch is whole and intact, it's just the display that's incorrect.


author: Manju
body: Can you add a screenshot? Is this on the macOS or Windows?


author: Dave Newman
body: This is on Windows 10. I'm not sure how to attach a srceenshot, but I'm game to try.


author: Dave Newman
body: Here are the 2 screen shots. Dev #1 (not me) get anxious and merged in a random commit from the master branch, but you should be able to see what's going on.

Please let me know if there's anything else I can send you to assist.

![AllBranches.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/14326iA2FE381677AC0D98/image-size/large?v=v2&px=999 "AllBranches.PNG")![CurrentBranch.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/14325iB168039BAF84FD73/image-size/large?v=v2&px=999 "CurrentBranch.PNG")


author: Mike Corsaro
body: Hey Dave, I think this might be a known bug that you're seeing. Can you try viewing the log with "All Branches" showing, but change "Date Order" to "Ancestor Order" and see if that looks right?


author: Dave Newman
body: Yep, you nailed it! Thanks for the prompt response. Any idea when you are going to get that fixed? We are running version 2.4.7.0, is there a newer version?


author: Mike Corsaro
body: Glad to hear. 2.4.8 is currently rolling out now but does not fix this specific issue. The next release (2.5.X) will address it, as well as include enterprise-specific features (it should be rolling out to the beta group within the next few weeks).

If you'd like to know more about this bug, you can track it [here](https://jira.atlassian.com/browse/SRCTREEWIN-7527?focusedCommentId=1711169&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-1711169)


Tags: windows