Search for text in all versions of a repository
git search all commits for string | find password committed to git history | git grep entire history | git | grep | searchgit rev-list --all | xargs git grep -F 'DB_PASSWORD'Passes all commits of the repository to git grep, which searches every snapshot for the fixed search string (-F). Each matching line starts with the commit hash and file path. Useful for checking whether credentials or certain code were ever in the repository, even if they have since been deleted.
Note: On large repositories with many commits this can take a long time and produce a huge number of matches, because unchanged files reappear in every commit. To narrow down when something happened, git log -S is better suited.
Also searched as
- git search all commits for string
- find password committed to git history
- git grep entire history