How can I init/update git submodules in a remote?

回眸只為那壹抹淺笑 提交于 2019-12-31 04:35:28

问题


I often use this pattern for easy deployment of websites:

I have a bare repo, which I push/pull to from my computer and this bare repo has a post-update hook that automatically does a pull in another repo (the live version).

However, if I add a submodule on my computer and push it, I have to manually connect to the remote and do the init/update.

Is there a way around it ?


回答1:


Do you have the ability to do more than a pull on the live server? You can do all of that in one (well, technically two) command:

git pull && git submodule update --init --recursive

This will recursively initialise and pull any submodules, and update existing submodules.

Hope that helps.



来源:https://stackoverflow.com/questions/8271839/how-can-i-init-update-git-submodules-in-a-remote

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!