2

I need a list of files which added/removed the string "textXYZ" in the project history.

git log -S"testXYZ"

gives me the list of commits which introduce or remove an instance of the string "testXYZ".

Unfortunately each of those commits have more than 10 files.

How do I get a particular file(s) which introduce or remove the string in the commit?

4

1 回答 1

2

Add the --stat option:

git log -S"testXYZ" --stat

Or to get the diffs, add --patch.

于 2012-07-18T08:42:11.643 回答