列出为特定 git commit 修改的文件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/21515084/
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 files modified for particular git commit
提问by TDHM
I have commit, abc
, and I want to list files that were modified for the commit.
我已提交,abc
并且我想列出为提交而修改的文件。
What is the git command which will list modified files for that commit?
将列出该提交的修改文件的 git 命令是什么?
回答by Greg Bacon
For filenames only:
仅适用于文件名:
git show --name-only abc
To see a summary of what happened to them:
要查看发生在他们身上的事情的摘要:
git show --name-status abc
回答by shantanusinghal
You can see the files changed in a particular commit as follows
您可以看到在特定提交中更改的文件如下
git show --stat <commit-hash>
Alternatively you can also view the patch introduced with each commit using the -p flag
或者,您还可以使用 -p 标志查看每次提交时引入的补丁
git log -p <commit-hash>
BTW git show
takes the same formatting arguments as git diff-tree
, here's the documentation for diff-tree.