linux - 在无法访问的服务器上自动部署 git

标签 linux git

我有几台服务器无法通过 SSH 或 HTTP 直接访问,但它们能够连接到互联网。

我想找到一种通过 git 自动部署更新的聪明方法。我可以做一个定期执行 git pull 的脚本,但这似乎不是最好的方法。

在这种情况下管理 git 部署的最佳方式是什么?

最佳答案

你可能想看看“git bundle”

我以前在“气隙”系统中使用过它。

git bundle create <file> <git-rev-list-args>

git bundle verify <file>

创建 bundle 后,您可以对 bundle 使用“git clone”或“git pull”。

这是来自“bundle”的手册页:

Some workflows require that one or more branches of development on one machine be replicated on another machine, but the two machines cannot be directly connected, and therefore the interactive Git protocols (git, ssh, rsync, http) cannot be used. This command provides support for git fetch and git pull to operate by packaging objects and references in an archive at the originating machine, then importing those into another repository using git fetch and git pull after moving the archive by some means (e.g., by sneakernet). As no direct connection between the repositories exists, the user must specify a basis for the bundle that is held by the destination repository: the bundle assumes that all objects in the basis are already in the destination repository.

关于linux - 在无法访问的服务器上自动部署 git,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35420606/

相关文章:

php - CentOS 不支持阿拉伯语

linux - 如何在不使用可加载内核模块(LKM)的情况下在/proc中添加文件

Linux命令解释

linux - 在 Red Hat Enterprise Linux 上安装 R Studio

git - Jenkins 管道中的 changeSet 错误(错误 :java. io.NotSerializableException : hudson. plugins.git.GitChangeSetList)

git - Microsoft Power Point 2016 的版本控制

git - 如何同步两个git仓库

linux - 在 bash 脚本中使用标志

git - "Move"文件到 Git 中自己的分支

git - NetBeans 未在源代码编辑器中显示版本控制更改