Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

List all commits (across all branches) for a given file

Tags:

git

This question is closely related to List all commits for a specific file however it is different. I want to find out which commits, across all branches, had modified a given file.

To make it more complex, the given file may or may not be in the working tree.

like image 976
Saurabh Nanda Avatar asked Sep 19 '11 05:09

Saurabh Nanda


People also ask

How do you see all commits for a file?

Use git log --all <filename> to view the commits influencing <filename> in all branches. Show activity on this post. Assuming the package "gitk" is already installed.

How can I see all branch 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.

Which command displays the list of all commits?

git log -p command displays the patch representing each commit.


2 Answers

Try this:

git log --all -- path 
like image 115
manojlds Avatar answered Sep 18 '22 13:09

manojlds


You can use gitk

gitk --all <path to file> (you need to install gitk)

e.g.

gitk --all -- /home/kit.ho/project/abc.txt

like image 44
TheOneTeam Avatar answered Sep 18 '22 13:09

TheOneTeam