Why is “origin/HEAD” shown when running “git branch -r”?

@robinst is correct.

In git, you can select which branch is checked out by default (i.e. when you clone). By default, origin/HEAD will point at that.

On GitHub, You can change this in the Admin settings for your GitHub repo. You can also do it from the command-line via

git remote set-head origin trunk

or delete it altogether via

git remote set-head origin -d

Example. Look at the ‘Switch Branches’ drop-down. trunk is checked, so origin/HEAD follows trunk.

Leave a Comment