Reputation: 158
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.
Upvotes: 4
Views: 409
Reputation: 2404
My apologies if this post ought rather to be a comment instead of an answer.
Git does not support aliases for branches.
Some good discussion on this subject in the answers to this StackOverflow question:
CORRECTION:
Actually, it looks like symbolic-ref is the way to alias a branch. There's a feature request on the Git mailing list with more info.
http://www.mail-archive.com/git%40vger.kernel.org/msg49171.html
Upvotes: 3
Reputation: 60555
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
Upvotes: 4