我如何在远程启动/更新git子模块?

编程入门 行业动态 更新时间:2024-10-11 03:15:37
本文介绍了我如何在远程启动/更新git子模块?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我经常使用这种模式轻松部署网站:

我有一个裸露的回购站,我从计算机上推/拉,并且此裸回购有一个但是,如果我在我的电脑上添加一个子模块并推送它,那么我必须要在另一个回购站点(实时版本)中进行拉动操作。

手动连接到远程并执行初始化/更新。

是否有解决方法?

解决方案

在现场服务器上做更多的事情吗?你可以在一个(技术上是两个)命令中完成所有这些工作:

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 --recursive

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

Hope that helps.

更多推荐

我如何在远程启动/更新git子模块?

本文发布于:2023-11-25 20:27:47,感谢您对本站的认可!
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:模块   如何在   git

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!