Git references
We said that a Git repository can be imagined as an acyclic graph, where every node, the commit, has a parent and a unique SHA-1 identifier. But during the previous chapters, we even used some references such as the HEAD
, branches, tags, and so on.
Git manages these references as files in the .git/refs
repository folder:
If you open one of those files, you will find it inside the SHA-1 of the commit they are tied to. As you can see, there are subfolders for tags and branches (called heads
).
Symbolic references
The HEAD
file instead is located in the .git
folder, as shown in the following screenshot:
HEAD
is a symbolic reference; symbolic references are references that point to other references, using the ref: <reference>
syntax. In this case, the HEAD
is currently pointing to the master
branch; if you check out another branch, you will see the file's content change, as shown in the following screenshot:
Ancestry references
In Git you often need to reference the past (for example...