Skip to content

Instantly share code, notes, and snippets.

@leoapost
Last active December 9, 2015 19:38
Show Gist options
  • Save leoapost/4318392 to your computer and use it in GitHub Desktop.
Save leoapost/4318392 to your computer and use it in GitHub Desktop.
Search for a keyword in every file that has been changed in the last 20 commits of a specific author
# Replace AUTHOR_NAME with the author's name
# Replace KEYWORD with the keyword you wanna find
for x in $(git log --author=AUTHOR_NAME --pretty=format:'%h' -n 20 | cut -d" " -f1) ; do for y in $(git show --pretty="format:" --name-only $x) ; do if [ -f $y ]; then echo $y ; grep -in 'KEYWORD' $y ; fi ; done ; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment