1

In this post, we explain that HEAD is a pointer. But I'm confused, I checked my repo and I have 'remotes/origin/master' and 'remotes/origin/HEAD'. Can we just point remote head to somewhere to that a user cloning a repo is already on another branch?

Community
  • 1
  • 1
code-gijoe
  • 6,949
  • 14
  • 67
  • 103
  • Wait, this file exists? `.git/refs/remotes/origin/HEAD`? If so, that means you have a branch called "HEAD". – Christopher Aug 08 '12 at 15:53
  • Maybe, not sure where it came from. I'm wondering if it was created by my cvs2git export... CVS has a HEAD, maybe that is why I have it in my remotes. – code-gijoe Aug 08 '12 at 15:56

1 Answers1

1

See this answer. It points you to this article and this other answer. For a GitHub repository, you can also follow this answer.

In short, if you have access to the remote repository, you can do this on the remote repository itself:

git symbolic-ref HEAD refs/heads/mybranch

Or on GitHub, do so through the admin page.

Community
  • 1
  • 1
Shahbaz
  • 46,337
  • 19
  • 116
  • 182