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