查看特定的 Git 提交
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7663451/
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
View a specific Git commit
提问by eykanal
Possible Duplicate:
Get Information about a SHA-1 commit object?
可能的重复:
获取有关 SHA-1 提交对象的信息?
I needed to check when a specific change was added to a file I'm working on, so I used the git blame
command. From that I obtained the hash of the relevant commit. Is there a way to see the log notes of just that commit, using the hash?All the docs talk about how to look at the whole tree.
我需要检查何时将特定更改添加到我正在处理的文件中,因此我使用了该git blame
命令。从中我获得了相关提交的哈希值。有没有办法使用哈希查看该提交的日志注释?所有的文档都在讨论如何查看整棵树。
I realize could just do git log <filename>
, but there are a lot of commits for the file, and I'm loathe to go through all of them looking for this one. A simple way to view the log notes would be appreciated.
我意识到可以这样做git log <filename>
,但是该文件有很多提交,而且我不愿意通过所有这些提交来寻找这个文件。一种查看日志注释的简单方法将不胜感激。
回答by Graham Borland
git show <revhash>
Documentation here. Or if that doesn't work, try Google Code's GIT Documentation
文档在这里。或者,如果这不起作用,请尝试Google Code 的 GIT 文档