HEAD: It’s Importance in Git

HEAD: It’s Importance in Git

Git can simply be referred to as a version control system that manages changes to a file or set of files over time such that there can be a recall to specific version later. It is of importance when two or more person are working on the same thing.

‘HEAD’ in Git can be defined as the reference to the currently checked out commit i.e a reference to the commit at the tip of the branch.

With the above simple definitions in mind, lets consider a scenario where Sandra and Shallom are working on the same project. Due to the distance constraint between them, they created a repository (repo) on a remote git service so as to allow them contribute without having to meet each other physically. In the cause of their work, Shallom unintentionally messes up the ‘repo’. This would have been a major setback if ‘HEAD’ was not present as they would had to start all over again but instead all they need to do is rollback to the last commit which the ‘HEAD’ helps point to.

Finally, from my simple analogy above it can be deduced that ‘HEAD’ helps reduce the likelihood of loosing a task due to human error.

Like what you read? Give ATANDA ABDULSEMIU a round of applause.
