我经常使用这种模式轻松部署网站:
我有一个裸露的回购站,我从计算机上推/拉,并且此裸回购有一个但是,如果我在我的电脑上添加一个子模块并推送它,那么我必须要在另一个回购站点(实时版本)中进行拉动操作。
手动连接到远程并执行初始化/更新。是否有解决方法?
解决方案在现场服务器上做更多的事情吗?你可以在一个(技术上是两个)命令中完成所有这些工作:
git pull&& git子模块更新--init --recursive这将递归地初始化并拉取任何子模块,并更新现有的子模块。
希望有所帮助。
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 ?
解决方案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 --recursiveThis will recursively initialise and pull any submodules, and update existing submodules.
Hope that helps.
更多推荐
我如何在远程启动/更新git子模块?
发布评论