Suppose I remember that I saved a word "XYZword"
to some file in a repo but it got killed and I can only remember the initial part "XYZ"
but nothing about the time or file. How can I grep this "XYZ"
over the whole history?
To search the full history of the current branch and get the line numbers:
git grep -n "XYZ" $(git rev-list --all)
git log -S[SOME_WORD_OR_REGEX]
will search your history for any changes that contain the word or regex you supplied. For more information, check out the pickaxe entry in gitdiffcore(7).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With