Skip to content

Instantly share code, notes, and snippets.

@indy
Created January 31, 2012 10:47
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 indy/1709858 to your computer and use it in GitHub Desktop.
Save indy/1709858 to your computer and use it in GitHub Desktop.
git-unpushed
function git-unpushed {
brinfo=$(git branch -v | grep $(git-branch-name))
if [[ $brinfo =~ ("[ahead "([[:digit:]]*)) ]]
then
echo "(${BASH_REMATCH[2]})"
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment