Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to list all commits that changed a specific file?

Tags:

git

commit

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

like image 244
Daniel Avatar asked Sep 13 '10 14:09

Daniel


People also ask

How do you find a list of files that have changed in a particular commit?

Find what file changed in a commit To find out which files changed in a given commit, use the git log --raw command.

How do I see file commit history?

Git file History provides information about the commit history associated with a file. To use it: Go to your project's Repository > Files. In the upper right corner, select History.

How can you view all the commits for a single file in eclipse?

Select a file or directory in the Editing page, and choose Git Log in the Actions menu. This will show all commits in your current local branch that involve changes to the chosen file or directory.

How do I list previous commits?

On GitHub.com, you can access your project history by selecting the commit button from the code tab on your project. Locally, you can use git log . The git log command enables you to display a list of all of the commits on your current branch. By default, the git log command presents a lot of information all at once.


1 Answers

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).

like image 78
jackrabb1t Avatar answered Oct 13 '22 19:10

jackrabb1t