当项目包含子模块时,您需要单独存储/取消存储所有子模块。有没有办法使用更少的操作来做到这一点?
此链接可能有帮助:
Easy way pull latest of all submodules
它是关于“pull ”命令的,但是有一些方法可以在所有子模块之间进行迭代。
最佳答案
您可以使用 foreach
在每个子模块上运行特定的 git 命令。例如,将“git stash”应用到每个模块使用这个:
git submodule foreach 'git stash'
类似地,以下命令将 check out master
分支,然后从远程源为每个子模块提取任何更新。
git submodule foreach 'git checkout master; git pull'
关于git - 将所有内容存储在 Git 中,包括所有子模块?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29557635/