Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
642 views
in Technique[技术] by (71.8m points)

git: list of all changed files including those in submodules

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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+)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...