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

git checkout <commit> doesn't update commit history

I was looking for git HEAD concept and I came across the  Atlassian git tutorial (checking out and reverting)

Now let us execute git checkout b

Sequence of commits on the master branch

This is an update to the "Commit History" tree

What does it mean 'This is an update to the Commit History'? This doesn't touch at all the Commit History, just takes out a specific commit into the working tree and, the most important thing, lets the subsequent commits to attach to the HEAD (and this seems to create an unnamed branch that should be avoided in most cases. The most common use case for this situation, called detached HEAD is for reading purposes).

1 answer

0 votes
BillyP Community Leader Jun 08, 2019

Hi @Agostino Sclauzero 

What I think you're asking is about:

git checkout -b [new_branch]

This creates a new branch from the current branch, usually master.  This updates the commit history so others can follow along with what was happening.  Also, it helps with reviewing code at a later time or merging specific features.  

I hope this helps :)

Suggest an answer

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

Webinar: Dean Leffingwell and Steve Elliot present on SAFe 5.0, come ask Dean and Steve questions!

...steemed Steve Elliot (head of product for Jira Align). Agenda: What’s new or changed in SAFe 5.0: Introduction of OKRs Essential SAFe How to achieve true business a...

130 views 0 1
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