Reputation: 141434
Please correct me if I'm wrong. Also, please provide documentation on the usage of "tip".
Each branch points at a commit. The head (or tip) is the commit at which a branch points. If there are ten branches then there are ten heads and ten tips!
HEAD is a "you are here" marker that points at a commit in one of two ways: most of the time, HEAD points to a branch which in turn points at a commit; other times, HEAD points directly at a commit. The latter is called detached HEAD.
Quotes are from git(1)
Upvotes: 3
Views: 619
Reputation: 66183
Branches (a.k.a. branch heads) mark points of interests in your repo. The metaphor isn't perfect, but you can think of branches as some sort of "bookmarks". Each branch points to a commit; that commit is called the tip of the branch.
HEAD
(note the uppercase) is different. It usually points to a branch, indicating which point of interest in your repo you're currently at. However, in some cases, HEAD
may also point directly to a commit (in which case your repo is said to have a "detached HEAD").
You can think of HEAD
as
For instance, in the following repository, the tip of the master
branch is the commit of abbreviated ID f42c5
; the tip of the develop
branch is the commit of abbreviated ID 190a3
; HEAD
points to master
, indicating that master
is currently checked out.
Upvotes: 4