Skip to content

Instantly share code, notes, and snippets.

@mRB0
Created May 11, 2017 13:21
Show Gist options
  • Save mRB0/1420dc12a98525f9f6db872dad52be29 to your computer and use it in GitHub Desktop.
Save mRB0/1420dc12a98525f9f6db872dad52be29 to your computer and use it in GitHub Desktop.
git alias for ahead-behind count
[alias]
aheadbehind = !"f() { against=${1:-master}; git rev-list --left-right --count $against...HEAD | awk '{print \"You are \" $2 \" commit(s) ahead of '$against' and \" $1 \" commit(s) behind\"}'; }; f"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment