Daniel Fanjul
Daniel Fanjul

Reputation: 3501

Change the branch name on github that references HEAD

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?

Upvotes: 14

Views: 6887

Answers (2)

(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.

Upvotes: 4

null
null

Reputation: 898

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

Upvotes: 6

Related Questions