Creating aliases for Git branch names

syntagma

Suppose I have the following branches in git:

  • master
  • release-2014-11-02-some-long-text

I would like to easily switch between those to, like this:

git checkout devel # checkout to master
git checkout release # checkout to the branch release currently points/aliases to, in this case:  release-2014-11-02-some-long-text (I would like to change this alias from time to time)

How can I do that in Git?

VonC

You can try using git symbolic-ref (as mentioned in "Is it possible to alias a branch in Git?"):

git symbolic-ref refs/heads/devel   refs/heads/master
git symbolic-ref refs/heads/release refs/heads/release-2014-11-02-some-long-text

You can find a similar example in this gist.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related