Search the whole history for a string

Bash

Finds every commit whose diff added or removed a piece of text, including in files long since deleted.

git log -S 'AWS_SECRET_KEY' --oneline --all

# With the surrounding diff:
git log -S 'AWS_SECRET_KEY' -p --all

More in Git

Random picks