Created
January 22, 2013 10:30
-
-
Save zedtux/4593648 to your computer and use it in GitHub Desktop.
That gist -- after having added to your ~/.gitconfig file as described -- will show a warning message if you have more than 1 stash. That help me to not forgot them and be lost later.
This file contains hidden or 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
[alias] | |
st = "!git_stash_check; git status" |
This file contains hidden or 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
#!/bin/bash | |
# | |
# This script display a warning when Git stash contains more that one item | |
# | |
GIT_STASH_LIST=`git stash list | wc -l | xargs` | |
if [[ $GIT_STASH_LIST != "0" && $GIT_STASH_LIST != "1" ]]; then | |
echo "WARNING: You have $GIT_STASH_LIST stashes!" | |
echo | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Obviously you have to put the script in a path included into your $PATH environment variable or put the full path in the .gitconfig file.