Skip to content

Instantly share code, notes, and snippets.

@zedtux
Created January 22, 2013 10:30
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zedtux/4593648 to your computer and use it in GitHub Desktop.
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.
[alias]
st = "!git_stash_check; git status"
#!/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
@zedtux
Copy link
Author

zedtux commented Jan 22, 2013

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.

@sevein
Copy link

sevein commented Mar 28, 2013

Sweet!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment