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

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How do I change what commit is considered 'master' on a branch?


Pretty new to source tree, this is probably a really simple issue, but a recent commit/push broke our scene. I tried reversing the commit, but that gave an error, so I ended up 'checking out' a prior working node and working from there. I'm having trouble getting the 'origin/master' 'origin/head' 'master' tags to move to the most recent node. (see red outline in image)

The scene was working on every node before that merge (the current 'master' node).

The scene is also now once again working on my current 'HEAD', but I'm not sure how to set that as the 'master' so to speak

Any thoughts on how to resolve this?





3 answers

I can't remember exactly how I resolved this particular issue, but I definitely recall creating a new branch and I feel like the issue wasn't present there, so I feel like I may have ended up making the new branch my primary branch and deleting the old one. Either that, or the rest of Mike's suggestion may have worked for me... I don't recall for sure.

Did this solution work for you? I did exactly as Mike instructed and every time I load my project its the same master branch it was before. Not the 'Temp' I was trying to revert back to. I've created 3 new branches now that I cant get rid of and I'm still having the same problem

0 votes
Mike Corsaro Atlassian Team Dec 05, 2018

Hello! The thing you're seeing is known as being on a detached HEAD. To fix this:

  • Create a new branch (hit the branch button)
  • Call it something like "Temp", make sure "Checkout new branch" is checked
  • When that's done, switch back to the master branch (just double click master in the sidebar)
  • Then, right click on "temp" in the sidebar, and click "merge 'Temp' into current branch". This will merge the changes you made on that detached HEAD back into the master branch
  • Your master branch will now have those changes you made (don't forget to push!), and everything should be working again

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Sourcetree

Tip from the team: configure your repos for hosting goodness!

Supported Platforms macOS Windows We recently introduced support for additional hosting services such as GitHub Enterprise, GitLab (Cloud, Community Edition, Enterprise Edition), and...

5,692 views 4 12
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you