Here is the branch dropdown on Github.com for my repository.
$ git branch -r
origin/HEAD -> origin/master
origin/dev
origin/master
Here is the branch dropdown on Github.com for my repository.
$ git branch -r
origin/HEAD -> origin/master
origin/dev
origin/master
HEAD
is not a branch, but it is a reference. References in git are basically pointers to commits with a name attached. In fact, branches and tags are references but there are also other types.
Now, HEAD
is a special reference that points to the currently checked out commit. In the case of a remote repository, it's the default commit that gets checked out if you clone the repo. This points to a branch most of the time. The common default is the master
branch which is the case here too.
HEAD
is not really a branch but a pointer (aka symref) to a branch (or commit).
Your local HEAD
points to the currently checked out branch. The remote origin/HEAD
points to the main branch, i.e. the branch checked out after a clone.