gitgit-branchgit-refspec

Git refs - why is it called heads instead of branches?


Just curious when you look in the git/refs directory:

.git/refs/heads
.git/refs/tags

why is it called refs/heads instead of refs/branches?


Solution

  • can you give example of heads that are not branches?

    A detached head is not a branch.
    But all branches are referenced by a HEAD, as direct reference to the last commit of their branch.