git:所有已更改文件的列表,包括子模块中的文件 [英] git: list of all changed files including those in submodules
问题描述
我希望获得所有文件的列表,这些文件在两个提交之间发生了变化,包括子模块中的提交。
我知道我可以这样做:
git diff --name-only --diff-filter = ACMR $ {revision} HEAD
它返回一个文件列表,包括子模块路径,但不包括其中的文件。
例子:
我更新了一个子模块。我承诺超级项目。现在我想获得所有已修改文件的列表。
您知道一种方法来完成这项工作吗?
在子模块中的提交差异gitlab ,
Git 2.11(2016年11月)介绍
git diff --submodule = diff
Git 2.14(2017年第3季度)将通过递归嵌套子模块来改善这种情况。
请参阅提交5a52214 (2017年5月4日)作者: Stefan Beller(stefanbeller
。
(由 Junio C Hamano - <$合并c $ c> gitster - 在 commit a531ecf ,2017年5月29日)
原始2012答案(2017年前的Git 2.14)
也许一条简单的线就够了:
git submodule foreach --recursive git diff --name-status
这实际上将子模块中的子模块列出子模块中的文件。来自git1.7.3 +)
I would like to get a list of all files, which have changed betweet two commits including those in submodules.
I know I can do this:
git diff --name-only --diff-filter=ACMR ${revision} HEAD
It returns a list of files, including the submodule-path, but not the files within.
Example: I've updated a submodule. I commited the super-project. Now I want to get a list of all files which have been modified.
Do you know a way to get this done?
解决方案Update 2017: as I mentioned in "see diff of commit on submodule in gitlab",
Git 2.11 (Nov. 2016) introduces
git diff --submodule=diff
Git 2.14 (Q3 2017) will improve that by recursing into nested submodules.
See commit 5a52214 (04 May 2017) by Stefan Beller (stefanbeller
).
(Merged by Junio C Hamano --gitster
-- in commit a531ecf, 29 May 2017)
Original 2012 answer (pre 2017 Git 2.14)
Maybe a simple line would be enough:
git submodule foreach --recursive git diff --name-status
That would actually list files in submodules within submodules.
(The--recursive
option comes from git1.7.3+)这篇关于git:所有已更改文件的列表,包括子模块中的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文