TLDR Web Dev · MISCELLANEOUS
HOW HEAD WORKS IN GIT
Summary from the TLDR Web Dev newsletter
Git’s HEAD refers to your current location in the Git repository, indicated either by a branch name or a commit ID stored in the .git/HEAD file. HEAD can also be used as a command parameter ('git show HEAD') to reference the currently checked-out commit. Git often includes HEAD in its output (such as 'HEAD detached') to provide context about your working state within the repository.