Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

create a git symbolic ref in remote repository

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?

like image 506
Daniel Fanjul Avatar asked May 11 '09 10:05

Daniel Fanjul


People also ask

What is git symbolic ref?

A symbolic ref is a regular file that stores a string that begins with ref: refs/ . For example, your . git/HEAD is a regular file whose contents is ref: refs/heads/master .

What is git remote ref?

Remotes. The third type of reference that you'll see is a remote reference. If you add a remote and push to it, Git stores the value you last pushed to that remote for each branch in the refs/remotes directory.

Does git follow symlinks?

GitBSLR will not automatically deduplicate anything, or otherwise create any symlinks for Git to follow. You have to create the symlinks yourself.

What is git Refspec?

A refspec maps a branch in the local repository to a branch in a remote repository. This makes it possible to manage remote branches using local Git commands and to configure some advanced git push and git fetch behavior.


2 Answers

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

like image 182
null Avatar answered Oct 16 '22 14:10

null


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

  • Now they have a drop-down menu for selecting the HEAD branch at http://repo.or.cz (example: http://repo.or.cz/editproj.cgi?name=for-me-and-for-all_imz.git);
  • and at http://gitorious.org, too (look somewhere in the settings);
  • and at http://GitHub.com: admin > Default Branch > (choose something) (thanks to @srcspider's answer);
  • and in Girar (running on http://git.altlinux.org to build packages for ALT's distro), one can the ssh interface for this:
$ 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.

like image 4
imz -- Ivan Zakharyaschev Avatar answered Oct 16 '22 14:10

imz -- Ivan Zakharyaschev