tags:

views:

65

answers:

2

Hi there!

Well, the subject says everything. Is there a way to list all commits that changed a specific file?

I don't mind if that involves some bash magic, but it'd be way cooler if git already has this feature and I'm just so dumb not to be able to find it anywhere.

If anyone can enlighten me on this, domo arigato.

Regards,

+2  A: 

git log path should do what you want. From the git log man:

[--] <path>…

Show only commits that affect any of the specified paths. To prevent confusion with 
options and branch names, paths may need to be prefixed with "-- " to separate them
from options or refnames.
Gabe Moothart
That did it!! Thank you!!
Mr. Leinad
+1  A: 

Should be as simple as git log <somepath>, check the manpage (git-log(1)).

Personally I like to use git log --stat <path> so I can see the impact of each commit on the file.

thenduks
Or even `-p` if you want to see the full diff, not just that it had some number of lines modified.
Jefromi
True, but that's pretty noisy considering most files have been changed many times over their lives. I don't want to see full diffs of every single commit that ever touched a file. I'm usually looking for a specific thing, so I can get a log with just impacts and then `git show` on the specific commits that look like they matter.
thenduks
+1 for `--stat`
Gabe Moothart