I have a file that is no longer referenced anywhere in my code. I am looking for find which commits removed a reference to this file. (I have no idea which files used to reference it).
I know that git log -S would find commits that either added or removed this string. What I am looking for really is the ability to limit this search to just those lines that were removed. Is this possible?
I would like to see an easier solution. But with some shell-Scripting it would look like:
for id in $(git log -Sstring --pretty=%h)
do
if [ "$(git show $id | grep "+.*string")" != "" ]
then
echo $id
fi
done
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