将更改传输到已断开连接的系统 - git包? [英] Transporting changes to disconnected system - git bundle?

查看:111
本文介绍了将更改传输到已断开连接的系统 - git包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个系统,一个用于测试,一个用于生产。他们已断开连接,并且都没有连接到互联网。



我对软件回购进行了重大更改,生产环境需要更新。这两个系统都有一个git repo的副本。 TEST上的代码在上次运输到PROD时被标记( 1.4.0 ),但我们必须对PROD系统进行紧急更改。然后将它们回溯到TEST。

我打算执行以下操作:



在TEST上:

  git bundle create import.bundle 1.4.0..master 

然后手动将捆绑包转到PROD。



在PROD上:

  git bundle verify import.bundle 
#假设一切正常
git remote add import /path/to/import.bundle
git pull import master
#...修正任何合并冲突

我相信这会给我一个最新的PROD系统,再加上我可以稍后重复步骤和一系列增量更改。



这会工作吗?编辑:

$ b $是$ git-fu
可以看到的问题吗? b

我可以用 git fetch import 和<$替换 git pull import master c $ c> git merge -X他们的import / master 。可能更好。

解决方案

git bundle 时间。您不需要将其添加为远程,您可以直接从它拉(如果我没记错的话)。



您也可以在USB磁盘。这个包只是一个单独的文件,在git之外更容易处理。


I have two systems, one for test and one for production. They are disconnected and neither is connected to the internet.

I have made significant changes to my software repo, and the production environment needs to be updated. Both systems have a copy of the git repo set up. The code on TEST was tagged when last transported to PROD (1.4.0), but we had to make emergency changes on the PROD system. These were then backported to TEST.

I intend to do the following:

On TEST:

git bundle create import.bundle 1.4.0..master

Then manually transfer the bundle to PROD.

On PROD:

git bundle verify import.bundle
# assuming all is well
git remote add import /path/to/import.bundle
git pull import master
# ...fix any merge conflicts

Which, I believe, will give me a PROD system that is up-to-date, plus I can then repeat the bundle create step later with an incremental set of changes.

Will this work? Are the problems that those with more git-fu can see?

EDIT:

I could replace the git pull import master with a git fetch import and git merge -X theirs import/master. Might be preferable.

解决方案

git bundle gives you the whole repository every time. You do not need to add it as a remote, you can just pull from it directly (if I recall correctly).

You can also just have a bare repo on the USB disk. The bundle is just a single file which is easier to handle outside of git.

这篇关于将更改传输到已断开连接的系统 - git包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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