简体   繁体   English

如何在子模块中使Git检出必要的提交?

[英]How to make Git checkout necessary commits in submodules?

git ls-tree -r HEAD | grep commit | while read _1 _2 ID PATH; do 
     (cd $PATH; git checkout $ID;)
done

I suspect there should be normal Git command for this, including to do it recursively for nested submodules. 我怀疑应该为此使用常规的Git命令,包括对嵌套子模块进行递归操作。

How to do it in normal way? 正常情况下该怎么做?

看起来只是普通的git submodule update

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM