I want to go back in time to the last commit which contained code such as, "ThisClass(object):". That code was subsequently removed from the project in a later commit.
I thought about using git bisect + grep/awk-ing. I've also heard that git grep may allow you to do this sort of thing, though I can't figure out the right command in the man pages.
Any thoughts?
Git ships with a command called grep that allows you to easily search through any committed tree, the working directory, or even the index for a string or regular expression.
Looking up changes for a specific commit If you have the hash for a commit, you can use the git show command to display the changes for that single commit. The output is identical to each individual commit when using git log -p .
Use the -S (search) argument to git log
:
git log -S 'ThisClass(object):'
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