Git - Head Branch

> Code - (Programming|Computer) Language > Code Versioning > Git

1 - About

The term “branch head” (or just “head”) is the snapshot of the (last|most recent) commit on a branch. It's also the parent of the next commit.


3 - Example

In the example below, the branch head of:

  • the branch A is the commit CA3
  • the branch B is the commit CB2
             CA1--CA2--CA3 <-- Branch A
 CM1--CM2--CM3 <-- master
             CB1--CB2 <-- Branch B

4 - Management

4.1 - Detached

Detached head means you are no longer on a branch, you have checked out a single commit in the history


git checkout master
git checkout yourBranch

4.2 - Show

4.2.1 - Remote

git remote show origin
* remote origin
  Fetch URL:
  Push  URL:
  HEAD branch: master
  Remote branches:
    branch-0.5      tracked
    branch-0.6      tracked
    branch-0.7      tracked
    branch-0.8      tracked
    branch-0.9      tracked
code/version/git/head.txt · Last modified: 2018/07/03 15:10 by gerardnico