Created
March 28, 2014 04:15
-
-
Save jwu/9825248 to your computer and use it in GitHub Desktop.
Git bash helper
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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