Created
November 21, 2014 19:18
-
-
Save mauro-oto/91a4bba7b39aead022e0 to your computer and use it in GitHub Desktop.
Show git stash count when opening a new terminal window
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
Add this to your .zshrc or .bashrc for a quick reminder of saved stashes: | |
git_stashes_count () { | |
st_num=$(/usr/bin/git stash list 2> /dev/null | wc -l | tr -d ' ') | |
if [[ $st_num != "0" ]]; then | |
echo "$fg[red]$st_num$reset_color" | |
else { | |
echo "0" | |
} | |
fi | |
} | |
echo "You have $(git_stashes_count) stashes saved" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment