Since getting involved in a Python development project at work, I’ve also had to start using Git.
There’s a lot about Git that I don’t fully understand, but I found the term ‘HEAD’ and the concept it refers to particularly opaque until I had a chat with a colleague about it.
Apparently, HEAD can be viewed as the currently checked-out branch, ie the one that you’re working on. My understanding is that HEAD is akin to a setting or property that tells Git where to point the details of edits you’ve made.
Just to confuse matters, it seems there is also a difference between ‘HEAD’ and ‘head’; with the uppercase version being the currently selected branch, and there being more than one ‘head’ for each branch in the repository.
A quick search of YouTube brings up this talk about Git, including explanation of key terms like HEAD/head.
Slight tangent, and it may be an old blog post now (2007), but I like Zack Rusin’s Git Cheat Sheet too – I’m a visual kind of person, and the commands sequence diagram suits my ‘scribble it on a whiteboard’ thought patterns quite nicely.
Hopefully the information above will help someone who’s where I was a little while ago, struggling to understand what Git is all about, and developing migraines in the process! Of course, if you feel my interpretation is incorrect, please feel free to leave a comment. Any input or clarification is welcome!