Git is one of the most tools used by software developers during the development process. A good project is one which can be easily tracked and integrated from scratch , hence the importance of git as a version control tool. I have used git for a month now and I am still learning the ropes of good version control practices. Git has provided documentation which covers all the git commands that can be used during development.
I will particularly cover what HEAD is in git and its importance. HEAD refers to the pointer to the current branch and the lastest commit made. While creating a project,one can create a branch or decide use the master branch. The master branch is a default branch in git. If you use the command ‘git branch’ , It will list all the branches that you have created including the master branch.
One uses ‘git checkout command to switch to the desired branch .i.e, git checkout <name of branch>. Let’s say you have a commit that has been pushed to the default master branch, the pointer becomes the HEAD.
The branch is also a pointer or a reference to your current commit. HEAD is a symbolic pointer and the current branch since it is the last state of the working directory. It is also the parent of your next commit.