Skip to content

Instantly share code, notes, and snippets.

@leoapost
Created December 17, 2012 13:45
Show Gist options
  • Save leoapost/4318379 to your computer and use it in GitHub Desktop.
Save leoapost/4318379 to your computer and use it in GitHub Desktop.
Search for a keyword in all commit affected files
# Replace KEYWORD with the keyword you wanna find
# Replace COMMIT_HASH with the actual hash (e.g. 2005b934aaad9b481f8966e618dabfc143ab8357)
for x in $(git show --pretty="format:" --name-only COMMIT_HASH) ; do if [ -f $x ]; then echo $x ; grep -in 'KEYWORD' $x ; fi ; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment