简体   繁体   English

断开版本控制

[英]Disconnected Version Control

My team works in disconnected mode. 我的团队在断开模式下工作。 ie They develop the applications and use SVN inside the company network to manage versioning for the code. 即,他们开发应用程序,并在公司网络内使用SVN来管理代码的版本控制。

I am sitting in customer's office with no direct access to my company's network from customer machines. 我坐在客户办公室,无法从客户机器直接访问我公司的网络。 I maintain my own SVN where I checkin the code drop received from my team daily and also make changes to code. 我维护自己的SVN,每天在此检查从团队收到的代码滴,并更改代码。

I face two issues in this mode of operation. 在这种操作模式下,我面临两个问题。

  1. If my team deletes / renames some files, and I simply paste the new code received from my team over my working copy.. the deleted files remain in my working copy. 如果我的团队删除/重命名了一些文件,而我只是将从我的团队收到的新代码粘贴到我的工作副本上,那么删除的文件将保留在我的工作副本中。
  2. To avoid the issue one.. I asked them to send me patch file. 为了避免这个问题,我要求他们向我发送补丁文件。 Patch file worked with better success rate but it failed to address Binary files. 修补程序文件的成功率更高,但无法处理二进制文件。 So if my team adds new images / xls templates etc into the codebase, I don't get them via patch file. 因此,如果我的团队将新的图像/ xls模板等添加到代码库中,则不会通过补丁文件获得它们。 2. 2。

Thus, I have started feeling that two disconnected SVN repositories is not the right solution for my situation. 因此,我开始感觉到两个断开连接的SVN存储库不是适合我的情况的正确解决方案。

  • Have you guys been in this situation before? 你们以前有过这种情况吗?
  • What did you do? 你做了什么?
  • Is there something in SVN that can help me for this? SVN中有什么可以帮助我实现这一目标的吗?
  • OR is there another version control system that would help me get over this issue? 还是有另一个版本控制系统可以帮助我解决此问题?
  • If yes, can you point me to relevant commands in the VCS? 如果是,您能指出我在VCS中的相关命令吗?

Free alternatives are preferred. 免费的替代品是首选。

I would couvert the SVN server to aa true DVCS like git. 我会将SVN服务器转换为git这样的真正DVCS。 Even without direct connection, changes between can be propagated using patches submitted by email (this works for binary files). 即使没有直接连接,也可以使用电子邮件提交的补丁来传播它们之间的更改(这适用于二进制文件)。 See man git-format-patches and man git-am . 参见man git-format-patchesman git-am And also man git-bundle if you do not plan reading the patches. 如果您不打算阅读补丁,也可以man git-bundle

If converting the central server is not an option, you can still ask someone on the SVN network to use git-svn before generating the patches he sends to you, or after applying the patches you send back to him. 如果不能转换中央服务器,您仍然可以在SVN网络上的某人使用git-svn之前,先生成他发送给您的补丁,或者在应用您发送回给他的补丁之后使用git-svn (Killing SVN would of course be a better long term solution.) (杀死SVN当然是一个更好的长期解决方案。)

You should look into git-svn. 您应该查看git-svn。 The basic idea is that instead of having a local svn working copy, you have a local git repository. 基本思想是,您没有本地svn工作副本,而是拥有本地git存储库。 You can make multiple local commits, then when you're done, push those local commits into the remote svn repository. 您可以进行多个本地提交,然后在完成后将这些本地提交推送到远程svn存储库中。 It allows you to work completely disconnected from the central svn repository, but still allows you to use version control in your day to day work. 它使您可以与中央svn库完全断开连接,但仍可以在日常工作中使用版本控制。

Have a look at bzr-svn as mentioned by @elevener, or, for a git equivalent, use git-svn 看看@elevener提到的bzr-svn ,或者,对于git等效项,使用git-svn

EDIT: 编辑:

I was under the impression that you sometimes have access to the company network where you can push/pull your changes. 我的印象是,您有时可以访问公司网络,在其中可以推/拉更改。 If that isn't true, then I guess manual patching is the only way to go (since you pretty much have no access to the company's SVN server.) 如果那不是真的,那么我猜想手动修补是唯一的方法(因为您几乎无法访问该公司的SVN服务器。)

Does your company provide access to internal network by some means (SSH? VPN?) ? 贵公司是否通过某种方式(SSH?VPN?)提供对内部网络的访问? If so, perhaps you can use SSH tunneling or VPN to access the SVN server. 如果是这样,也许您可​​以使用SSH隧道或VPN访问SVN服务器。

If you are in a different network and don't have access to your VCS, only manual patching will work. 如果您位于其他网络中,并且无权访问VCS,则只能进行手动修补。 Even in DVCS (git or mercurial), you have to be in the same network to push or pull from the remote repo. 即使在DVCS(git或mercurial)中,也必须位于同一网络中才能从远程存储库中进行推送或提取。 So, as far as I know, manual patching is the only solution in your case. 因此,据我所知,手动修补是您唯一的解决方案。

Any comments from the SVN experts? SVN专家有何评论?

Haven't used it myself but AFAIK you can use Bazaar. 我自己没有使用过,但是AFAIK可以使用Bazaar。 It's a Distributed Version Control that is able use SVN as a central repository. 这是一个分布式版本控制,可以使用SVN作为中央存储库。

See bzr-svn . 参见bzr-svn

Have a look at git-bundle for the sneakernet transfer step. 在sneakernet转移步骤中查看git-bundle It should allow you to package up a bundle of changes for manual transfer across the VPN between the networks. 它应该允许您打包一捆更改,以便在网络之间通过VPN进行手动传输。

I've been looking at a the exchange problem myself (see my various SO questions) and I think they can be made to work, though you may need to use that company laptop ;-) 我自己一直在研究交换问题(请参阅我的各种SO问题),我认为可以使它们起作用,尽管您可能需要使用该公司的笔记本电脑;-)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM