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

Checkout hash not branch

I'm just wonder if there is posibility to checkout just commit (hash) but NOT checkout the branch.

So basically I will end up with detached head. And it's what I want.

 

Reason why:
when you are reviwing someone code, you want to have the full codebase in your machine, so you want to checkout the changes. But when I checkout branch, I will create my local branch and I will have to "keep it up-to-date" if they will move the original one.

So the easy way is to just checkout the commit it self (by checkout hash) and not have the branch at all. No need to delete the branch later, if they will finish the work and merge it.

Workaround:
Right now, I just copy hash (context menu), open console, and manually write `git checkout [paste the hash]`

But it will be easier if I could do it from application itself :)

1 answer

0 votes
Manju Atlassian Team Jul 21, 2017

If you are using it on the macOS, just double click on the table row for the commit you want to check out. And I presume, its similar on widnows too.

Not quite... If you just double click, it will be the same as you will select "Checkout" in context menu.

But if you do this on commit which is the head of some branch, you will see the window "Checkout New Branch".

And this is what I DON'T want to do. Because I want to checkout just commit not branch, and stay in detached head state.

Suggest an answer

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

Sourcetree for Windows - CVE-2019-11582 - Remote Code Execution vulnerability

A vulnerability has been published today in regards to Sourcetree for Windows.  The goal of this article is to give you a summary of information we have gathered from Atlassian Community as a st...

4,965 views 0 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