Git references
In the previous section, we have seen that a Git repository can be imagined as a tree that, starting from a root (the root-commit), grows upward through one or more branches.
These branches are generally distinguished by a name. In this Git is no exception; if you remember, the experiments conducted so far led us to commit to the master
branch of our test repository. Master is precisely the name of the default branch of a Git repository, somewhat like trunk
is for Subversion.
But Subversion analogies end here: we will now see how Git handles branches, and for Subversion users it will be a little surprising.
It's all about labels
In Git, a branch is nothing more than a label, a mobile label placed on a commit.
In fact, every leaf on a Git branch has to be labeled with a meaningful name to allow us to reach it and then move around, go back, merge, rebase, or discard some commits when needed.
Let's start exploring this topic by checking the current status of our grocery
repository...