如何列出已为特定提交修改的文件? [复制]
Posted
技术标签:
【中文标题】如何列出已为特定提交修改的文件? [复制]【英文标题】:How do I list the files that has been modified for a particular commit? [duplicate] 【发布时间】:2016-12-03 18:29:51 【问题描述】:假设我为某个项目做了一系列提交,所以当我git log --oneline
时,它会产生以下内容
e61c4fb Wrote the special problem review of related literature.
eb584ba Wrote the special problem objectives.
8d2dd52 Added more research papers
72a2d27 Fixed the bug during the removal of parent chromosomes in ga_wknn and saga_wknn
d7467df Added as the k in KNN as a parameter in the constructor of each application.
2293f43 Added a simulation result.
bdfcf41 Done with adding Introduction Comments
接下来我想查看在其中一个提交中添加、修改、删除的文件。我试过了
git diff d7467df
但它也向我显示了每个文件的修改内容,这使整个事情变得很长。我只想查看已更改的列表文件,并且没有关联的内容。我如何做到这一点?
【问题讨论】:
git diff d7467df^ d7467df --name-only
【参考方案1】:
git show --name-only commit_hash
【讨论】:
做同样的事情:git log -1 --name-only commit_hash
【参考方案2】:
只列出修改过的文件,没有多余的信息:
git diff-tree --no-commit-id --name-only -r commit_id
【讨论】:
以上是关于如何列出已为特定提交修改的文件? [复制]的主要内容,如果未能解决你的问题,请参考以下文章