Last active
April 5, 2019 13:33
-
-
Save benjishults/3cf4d88d43df0776a215bd2ee4a331fa to your computer and use it in GitHub Desktop.
check whether there is a stash in the current branch
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
#!/bin/bash | |
# put this file in the folder containing your repo folders. | |
# when run, it will check whether there is a stash in the current branch | |
pushd . &> /dev/null | |
for dir in $( find . -maxdepth 1 -type d -print ) | |
do | |
popd &> /dev/null; | |
pushd "$dir" &> /dev/null; | |
if | |
[ "$dir" != "." -a -d .git ] | |
then | |
msg="$(git stash list)"; | |
if [ ! -z "$msg" ] | |
then | |
echo -e "\033[1;31m${dir} has a stash:\033[0m"; | |
echo "$msg"; | |
echo | |
else | |
echo "$dir has NO STASH" | |
fi | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment