DEV Community

Discussion on: Git cheatsheet for beginners

Collapse
 
aleksandrhovhannisyan profile image
Aleksandr Hovhannisyan • Edited

It's where you are currently

Yup!

And on that note, in my personal experience, commits and branching become much easier to understand and visualize once you think of your commit history as a linked list, and HEAD as a pointer that you can position at will.

In fact, this is hinted at in the syntax of git log: HEAD -> master, where HEAD is quite literally pointing to master (assuming that's where we are atm).

Also, I agree: We shouldn't make things simpler for beginners, even if it means they may initially be confused. It's part of the learning process!

Collapse
 
jeansmaug profile image
jean-smaug • Edited

IMHO the best way to demystify what HEAD is, is to go inside the .git folder.
After that you go to the refs folder and you can explain the branches ;)

head-ref

Personally I understood many things by watching inside this .git folder.

I didn't mention that, but your article is nice. I will send it to my students :)