How do I change a Git remote HEAD to point to something besides "master"

Posted by jhs on Stack Overflow See other posts from Stack Overflow or by jhs
Published on 2009-09-28T05:42:57Z Indexed on 2010/06/03 1:14 UTC
Read the original article Hit count: 340

Filed under:
|
|

Short version: How do I set a Git remote's HEAD ref to point to something besides "master"?

My project has a policy not to use a "master" branch (all branches are to have meaningful names). Furthermore, the canonical master repository is only accessible via ssh://, with no shell access (like GitHub or Unfuddle).

My problem is that the remote repository still has a HEAD reference to refs/heads/master, but I need it to point to a different branch. This is causing two problems:

  1. When cloning the repo, there this, warning: remote HEAD refers to nonexistent ref, unable to checkout. That's confusing and inconvenient.
  2. The web-based code browser depends on HEAD as a basis for browsing the tree. I need HEAD to point to a valid branch, then.

© Stack Overflow or respective owner

Related posts about git

Related posts about github