Skip to content

Instantly share code, notes, and snippets.

@qur2
Last active December 14, 2015 19:09
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 qur2/5134864 to your computer and use it in GitHub Desktop.
Save qur2/5134864 to your computer and use it in GitHub Desktop.
Aliases for shell awesomeness
[alias]
oldest-ancestor = !bash -c 'diff -u <(git rev-list --first-parent "${1:-master}") <(git rev-list --first-parent "${2:-HEAD}") | sed -ne \"s/^ //p\" | head -1' -
recently = !bash -c 'git for-each-ref --count=30 --sort=-committerdate refs/heads/ --format=\"%(refname:short)\"'
branchdiff = !bash -c 'git diff `git oldest-ancestor "${1:-master}" "${2:-HEAD}"`..."${2:-HEAD}"' -
branchlog = !bash -c 'git log --oneline `git oldest-ancestor "${1:-master}" "${2:-HEAD}"`..."${2:-HEAD}"' -
thebranch = !bash -c 'git branch | sed -ne \"s/^\\* \\(.*\\)/\\1/p\"'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment