Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a GIT branch that point to another branch instead of a commit

Tags:

git

git-branch

Knowing that a branch is a pointer to the last commit. By example, the master branch is linked to the commit C1.

I want to know if it's possible to link a branch to another branch instead of a commit, which would make it a pointer of pointer (for those accustomed in C).

By example, I would like the master branch point to a release branch (by example 1.1). And if by any chance, a commit would happen in the branch 1.1, the master HEAD would follow the 1.1 HEAD.

like image 448
DaikonBoy Avatar asked Mar 20 '23 09:03

DaikonBoy


1 Answers

Yes, you can make branch aliases or aliases to any ref. Say:

git symbolic-ref refs/heads/trackmaster refs/heads/realmaster

and you no longer have to manually catch up (possibly temporarily-)joined LOD's

like image 53
jthill Avatar answered Apr 25 '23 07:04

jthill