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

Master branch split into two branches in Sourcetree

Dave Newman February 7, 2018

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

1 answer

1 accepted

0 votes
Answer accepted
Manju
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 7, 2018

Merging the orphan branch to master might resolve this discrepancy. Have you tried it?

Dave Newman February 7, 2018

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

Manju
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 7, 2018

Can you add a screenshot? Is this on the macOS or Windows?

Dave Newman February 7, 2018

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

Dave Newman February 7, 2018

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.PNGCurrentBranch.PNG

Mike Corsaro
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 7, 2018

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?

Like nadorozhnyy likes this
Dave Newman February 7, 2018

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?

Mike Corsaro
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 7, 2018

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events