14

In my remote bare repository the HEAD is pointing to "refs/heads/master" and I want it to point to "refs/heads/other".

I am not able to go to remote repository directory and run git symbolic-ref. Is there any git command to achieve it? Or any other way?

If there is no way, does Github allow one to change the HEAD?

Thanks in advance.

wogsland
  • 7,351
  • 16
  • 46
  • 79
Daniel Fanjul
  • 3,433
  • 3
  • 24
  • 28

2 Answers2

6

To change it in github, go to the admin section.
You can select the default branch from a dropdown there.

null
  • 788
  • 5
  • 11
  • 3
    Hmmmm... the existence of that drop-down is a strong indicator that there's no way to do it purely using Git commands. – kbro Jul 22 '10 at 14:21
4

(There has been posted another question asking basically the same: How do I change a Git remote HEAD to point to something besides “master”, and there was more discussion there, with a reference to the Github group. So I'd just like to point anyone to that discussion as well.)

As we know, there is no universal answer.

But there are a specific answers for various git "farms" (where multiple users can manage git repos through a restricted interface: via http and ssh): http://Github.com, http://Gitorious.org, http://repo.or.cz, Girar (http://git.altlinux.org).

These specific answers might be useful for those reading this page and thinking about these specific services.

$ ssh git.alt help | fgrep branch
default-branch  []
$ 

for example ssh git.alt default-branch packages/autosshd.git sisyphus to change the HEAD in the remote repo autosshd.git to point to the sisyphus branch.

Community
  • 1
  • 1
  • 3
    This should have been a comment, because it's not an answer. – Evan Kroske Nov 21 '10 at 00:48
  • It's a perfect answer. _Is there any git command to \[change a symbolic ref on a remote repository\]? Or any other way?_ There is no git command, but here are a few examples of how you do it on various git hosting services. – clacke Mar 28 '17 at 16:42