如何在git中查找从一次提交更改为另一次提交的文件数 [英] How to find the number of files changed from one commit to another in git
本文介绍了如何在git中查找从一次提交更改为另一次提交的文件数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在一个git存储库中,该存储库包含通过一次提交更改为另一个提交的大量文件,以及如何提取通过多次提交更改的文件的数量.
I am working on a git repository which contains huge number of files changed b/w one commit to another, how to extract the number of files changes b/w commits.
推荐答案
这将始终对文件加一,因为--format=oneline
包括commit-hash/header".正如c00kiemon5ter
"this will always count the files plus one, cause the --format=oneline
includes the commit-hash/header" as mentioned by c00kiemon5ter
git whatchanged
工具向您显示已修改文件的摘要.它本身列出了所有提交,但您也可以将其限制为最近的 n 提交:
The git whatchanged
tool shows you a summary of files that were modified. By itself it lists all commits, but you can also limit it to just the recent n commits:
git whatchanged -1
要计数文件:
git whatchanged -1 --format=oneline | wc -l
有关详细信息,请参见git help whatchanged
.
这篇关于如何在git中查找从一次提交更改为另一次提交的文件数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文