git 列出给定文件的所有提交(跨所有分支)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7466709/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
List all commits (across all branches) for a given file
提问by Saurabh Nanda
This question is closely related to List all commits for a specific filehowever 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.
为了使它更复杂,给定的文件可能在也可能不在工作树中。
采纳答案by Kit Ho
You can use gitk
你可以使用 gitk
gitk --all <path to file> (you need to install gitk)
gitk --all <path to file> (you need to install gitk)
e.g.
例如
gitk --all -- /home/kit.ho/project/abc.txt
gitk --all -- /home/kit.ho/project/abc.txt
回答by manojlds
Try this:
尝试这个:
git log --all -- path