Git Head and its important

A head as its name implies means “top part of”, “front of”, “top-ranking” etc. Git head is simply a reference to a commit object. Each head has a name (branch name or tag name, etc).A head keeps track of a new(latest version) commit object. A head also name the commit on which you based the changes in the working tree. Also, a HEAD is normally refers to a named branch (e.g. master). Meanwhile, each branch refers to a specific commit.

HEAD always refers to the most recent commit on the current branch. When you change branches, HEAD is updated to refer to the new branch’s latest commit. In normal states, it’s actually a symbolic ref to the branch you have checked out — if you look at the contents of .git/HEAD you’ll see something like “ref: refs/heads/master”. The branch itself is a reference to the commit at the tip of the branch. Therefor e, in the normal state, HEAD effectively refers to the commit at the tip of the current branch.

A git head is very relevant and important, it holds the latest version of your commit.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.