How to Work with the HEAD Pointer in Git


show more Working with the HEAD pointer provides you with in-depth training on Developer. Taught by Kevin Skoglund as part of the Git Essential Training show less
please wait ...

Working with the HEAD pointer

In this movie we'll gain an understanding of the HEAD pointer in Git. Git maintains a reference variable called HEAD, all capitals, H-E-A-D. And we call this variable a pointer, because its purpose is to reference, or point to, a specific commit in the repository as we make new commits the pointer is going to change or move to point to a new commit. HEAD always points to the tip of the current branch in our repository. Now this has to do with our repository, not our staging index, or our working directory, we're talking just about the repository the commits that we've actually made to the repository by checking them in.

Another way to think of it is the last state of our repository or what was last checked out, and because it's where the repository left off or the last state, you can also say that the HEAD points to the parent of the next commit or it's where commit writing is going to take place. I think a good metaphor to think about this is the playback and record head on a ca...

Working with the HEAD pointer
Video duration: 6m 25s 6h 25m Beginner

Viewers:

Working with the HEAD pointer provides you with in-depth training on Developer. Taught by Kevin Skoglund as part of the Git Essential Training

Subject:
Developer
Software:
Git GitHub
Author:
please wait ...