Skip to content

Instantly share code, notes, and snippets.

@benjishults
Last active April 5, 2019 13:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benjishults/3cf4d88d43df0776a215bd2ee4a331fa to your computer and use it in GitHub Desktop.
Save benjishults/3cf4d88d43df0776a215bd2ee4a331fa to your computer and use it in GitHub Desktop.
check whether there is a stash in the current branch
#!/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