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

这个问题与 List all commits for a specific file密切相关,但又有所不同。我想知道哪个提交 在所有的树枝上修改了给定的文件。

为了使其更加复杂,给定的文件可能在工作树中,也可能不在工作树中。

41005 次浏览

试试这个:

git log --all -- path

你可以用 gitk

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

例如:。

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

Command line

我强烈推荐使用 git log 添加图形选项:

git log --graph --all -- <filename>

git log --graph --all -- <filename>

阿贵

Gitk 是一个相当老的工具,并不总是安装,我推荐一个不同的免费工具,比如 SourceTree:

SourceTree