Skip to content

Instantly share code, notes, and snippets.

@jwu
Created March 28, 2014 04:15
Show Gist options
  • Save jwu/9825248 to your computer and use it in GitHub Desktop.
Save jwu/9825248 to your computer and use it in GitHub Desktop.
Git bash helper
# check if our commits is ahead of origin
result=$(git cherry -v)
if [ ! "${result}" == "" ]; then
echo "You have commits ahead of origin, try git push."
fi
# check if we have uncommit changes
if ! git diff-index --quiet HEAD --; then
echo "You have uncommit changes."
echo "Note: this command will not detect unstaged new files"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment