Skip to content

Instantly share code, notes, and snippets.

@rkhmelyuk
Created April 24, 2014 02:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rkhmelyuk/11239443 to your computer and use it in GitHub Desktop.
Save rkhmelyuk/11239443 to your computer and use it in GitHub Desktop.
using git symbolic ref to save some time
git symbolic-ref -m 'short alias m to mainline' refs/heads/m refs/heads/mainline
git symbolic-ref -m 'short alias h to HEAD' h HEAD
Now you can use the m and h aliases in git commands:
git log m
git diff m..h
git show-ref m
git branch
m -> mainline
* mainline
tail .git/h .git/refs/heads/m
==> .git/h <==
ref: HEAD
==> .git/refs/heads/m <==
ref: refs/heads/mainline
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment