Skip to content

Instantly share code, notes, and snippets.

@ezza
Forked from hartym/git-stash-grep
Last active December 28, 2015 02:09
Show Gist options
  • Save ezza/7425563 to your computer and use it in GitHub Desktop.
Save ezza/7425563 to your computer and use it in GitHub Desktop.
Add to bashrc so you can stashgrep term
# added to ~/.bashrc
stashgrep() {
for i in `git stash list --format="%gd"`; do
git stash show -p $i | grep -H --label="$i" "$1"
done
}
# usage:
# stashgrep zip
# returns
# stash@{1}: rubyzip (0.9.6.1)
# stash@{3}:+ def zip(filename, data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment