有没有办法让git pull自动更新子模块? [英] Is there a way to make git pull automatically update submodules?

查看:723
本文介绍了有没有办法让git pull自动更新子模块?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有办法自动地有时调用 git子模块更新(或者最好是 git子模块更新--init > git pull 完成了吗?

Is there a way to automatically have git submodule update (or preferably git submodule update --init called whenever git pull is done?

寻找一个git config设置,或者一个git别名来帮助解决这个问题。 / p>

Looking for a git config setting, or a git alias to help with this.

推荐答案

git config --global alias.pullall'!git pull&&git submodule update - -init --recursive'

如果您想将参数传递给git pull,请使用它:

If you want arguments to be passed to git pull, then use this instead:

git config --global alias.pullall '!f(){ git pull "$@" && git submodule update --init --recursive; }; f'

这篇关于有没有办法让git pull自动更新子模块?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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