Created
June 4, 2018 11:14
-
-
Save Bahanix/c057abc4e66ef261b43f79188b85dfb9 to your computer and use it in GitHub Desktop.
post-checkout hook to display if you had stashed something on this branch
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/sh | |
STASH_NAME="$(git stash list | grep `git branch | grep \* | cut -d ' ' -f2` | head -n1 | cut -d':' -f1)" | |
if [ -n "$STASH_NAME" ] | |
then | |
echo "Last stash on this branch:" | |
git --no-pager stash show "$STASH_NAME" -p | |
echo "To keep your stash list clean, consider using one of the followings:" | |
echo "git stash pop \"$STASH_NAME\"" | |
echo "git stash drop \"$STASH_NAME\"" | |
fi |
orent
commented
Jun 5, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment