Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GitHub remote symbolic ref/branch alias

Tags:

On a GitHub repo, I'd like the master branch to actually be an alias to a x.y.z branch. As a consequence, all fetch/push from x.y.z and master would result to the exact same result. I do want to keep the master branch because people are used to it, but also want the x.y.z branch to not make master a special-case of a branch name (other branches are a.b.c, d.e.f...).

Is there a way to achieve that on GitHub? Or on a Git remote repository in general?

like image 898
Mickael Avatar asked May 26 '16 08:05

Mickael


1 Answers

On GitHub side, you can change the default branch.
On a remote repo side, you can similarly change the default branch.

Setting a branch alias is not directly possible on GitHub side.
It is on a remote hosting git repo server you have access to:

git symbolic-ref refs/heads/master refs/heads/x.y.z

But the alias part would not propagate to a git cloned repo: while every new clone would checkout by default x.y.z, their user would have to setup the alias locally.

like image 66
VonC Avatar answered Sep 28 '22 03:09

VonC