Created
May 28, 2015 19:45
-
-
Save oranj/3e65e3bc02e85961f8a7 to your computer and use it in GitHub Desktop.
stash_search
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 | |
i=0; | |
git stash list | while read stash; do | |
git stash show -p --name-only "stash@{$i}" | grep "$1"; | |
status=$?; | |
if [ $status -eq 0 ]; then | |
echo " in $stash"; | |
fi | |
((i++)) | |
done; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
use in a git project to search the git stash for a file name