How can I list all commits that changed a specific file?

Daniel picture Daniel · Sep 13, 2010 · Viewed 314.2k times · Source

Is there a way to list all commits that changed a specific file?

Answer

jackrabb1t picture jackrabb1t · Jan 10, 2012

The --follow works for a particular file

git log --follow -- filename

Difference to other solutions given

Note that other solutions include git log path (without the --follow). That approach is handy if you want to track e.g. changes in a directory, but stumbles when files were renamed (thus use --follow filename).