Skip to content

Instantly share code, notes, and snippets.

@twobitlabs
Last active August 29, 2015 14:22
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 twobitlabs/561a86f06be21370a9d4 to your computer and use it in GitHub Desktop.
Save twobitlabs/561a86f06be21370a9d4 to your computer and use it in GitHub Desktop.
search diff commits
git-search-diffs() {
if [ -z "$2" ]
then
echo "Use git-search-diffs to search for commits where the diff includes the search term"
echo "Usage: git-search-diffs <path> <search term>"
return
fi
git log -p $1 | egrep -i "^commit|^[-+].*$2" | egrep -B1 ^[+-]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment