从导出的Git存储库中脱机更新文件 [英] Update files from an exported Git repository offline

查看:148
本文介绍了从导出的Git存储库中脱机更新文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

让我先描述一下这个场景,并且所有这些都需要在没有连接到互联网的情况下进行。 Windows方法优于Linux。

客户有我们软件的一个版本,它是由CD交付的。在我们的存储库上进行了一定次数的推送后,我希望客户端可以接收这些文件更新,而无需重新传送所有文件。我只想提供一个存储库的副本,并让git将其旧文件更新为当前状态。不需要访问历史记录或分支机构,只需要复制每个文件的最新版本即可。



所以问题是什么是将单独脱机文件更新为当前外部存储库状态的最佳(最简单)方法?



我已经阅读了一些可能性,但我不了解它们的差异或能力或确切的过程和命令。此外,我找到的每个示例都使用https:来传输文件。
$ b <1>远程添加,远程更新,然后合并
$ b <2>克隆存储库然后用户将

3)git archive创建一个tarball



4)捆绑包似乎只适用于未推送的提交。

如果可能的话,写出cmd命令也会非常有帮助。

解决方案

如果我正确理解您的情况,那么您可以使用 git diff --patch生成补丁文件< revision_of_customer> > latest_version.patch ,然后使用 patch 实用程序将其应用于客户端。这种方法仅适用于文本文件。如果您的存储库中有二进制文件,则可以查看推荐的实用程序(此处


Let me describe the scenario first and all of this needs to occur without connecting to the internet. A Windows method is preferred over Linux.

A client has a version of our software that was hand delivered by CD. After a certain number of pushes are made on our repository, I would like for the client to receive these updates to the files without having to redeliver all the files. I would like to only have to deliver a copy of the repository and have git update their older files to the current state. Access to history or branches is not necessary, only the most current version of each file is required to be copied.

So the question, What is the best (easiest) method to update separate offline files to a current external repository state?

I have read of a few possibilities but I do not understand the differences or capabilities of them or the exact process and commands. Furthermore, every example I have found uses https: to transfer the files.

1) remote add, remote update, then merge

2) clone repository then user would pull

3) git archive to create a tarball

4) bundle appears to be only for un-pushed commits.

It would be extremely helpful to have the cmd commands written out as well if possible.

解决方案

If I understood your case properly then you can generate a patch file using git diff --patch <revision_of_customer> > latest_version.patch and then apply it on customer's side using patch utility. This approach will be working for text files only. If you have binary files in your repository you can take a look at utilities recommended here.

这篇关于从导出的Git存储库中脱机更新文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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