Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is there a `remotes/origin/HEAD -> origin/master` entry in my `git branch -l -a` output?

Tags:

git

branch

I don't understand the second line in the output to git branch -l -a: remotes/origin/HEAD -> origin/master.

git branch -l -a * master   remotes/origin/HEAD -> origin/master   remotes/origin/master 

Is that a leftover from another operation? Should I clean it up? And how would I do that?

Usually I work with git on the cli, but on this local repository I experimented with TortoiseGit to find an easy git workflow for a friend.

like image 587
mistaecko Avatar asked Sep 27 '12 03:09

mistaecko


1 Answers

No, no need to clean up: it is the symbolic branch referenced by your remote repo.
When you clone your repo, you will be by default on the branch referenced by remotes/origin/HEAD.

See also:

  • "Git: Correct way to change Active Branch in a bare repository?"
  • "How do I change a Git remote HEAD to point to something besides “master”"
  • "How does origin/HEAD get set?"

Note: on Git versions older than 2.20, you need to use git branch --list (or git branch), not git branch -l.

like image 102
VonC Avatar answered Sep 21 '22 06:09

VonC