git:所有已更改文件的列表,包括子模块中的文件 [英] git: list of all changed files including those in submodules

查看:99
本文介绍了git:所有已更改文件的列表,包括子模块中的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望获得所有文件的列表,这些文件在两个提交之间发生了变化,包括子模块中的提交。



我知道我可以这样做:

  git diff --name-only --diff-filter = ACMR $ {revision} HEAD 



它返回一个文件列表,包括子模块路径,但不包括其中的文件。



例子:
我更新了一个子模块。我承诺超级项目。现在我想获得所有已修改文件的列表。



您知道一种方法来完成这项工作吗?

在子模块中的提交差异gitlab ,






原始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",


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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆