I am using TortoiseGit for Windows. I see two branches on remote/origin:
HEAD 20 minutes ago Some commit message.
master 20 minutes ago Some commit message.
I am confused why HEAD shows up as a branch; I did not explicitly create a separate branch on origin – it should only be ‘master’. It’s not really a problem, since they seem to update together anyway.
If I execute git branch on origin, it only shows ‘master’.
Why are there two branches? Is this a TortoiseGit-specific thing, or a Git-specific thing? Thanks!
It’s a git-specific thing.
HEADis a reference to the currently checked out thing, i.e. usually a branch. In your case,HEADis simply an alias formaster. TortoiseGit apparently can’t tell an alias (“symbolic ref”) from a normal branch, so it appears as ifHEADis an extra branch when it really isn’t.The situation is a bit different for remote repositories which usually don’t have anything checked out at all. You seem to be looking at a remote repository here. In that case, that repository’s
HEADis used to determine which branch is checked out by default when someone clones that repository. That’s why, when you clone, some branch or another is checked out: git doesn’t just randomly pick a branch, but it looks at the source repository’sHEADto make that decision.