我可以在两个 SVN 存储库中拥有一个项目吗? [英] Can I have one project in two SVN repositories?

查看:30
本文介绍了我可以在两个 SVN 存储库中拥有一个项目吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的 IT部门不允许从物理办公室外部连接到 SVN 服务器.(他们就是那样.)我不在办公室时需要处理项目.

Our I.T. dept doesn't allow connections to the SVN server from outside the physical office. (They're just kind of like that.) I need to work on projects when I'm not at the office.

我可以先检查一下项目,然后等到我进来进行检查.也许那样最好.但我喜欢经常入住.我想知道是否有某种方法可以将一个项目保存在两个存储库中并保持它们都是最新的.这样我就总能在某个地方登记,以防我的 HD 死机.我在用于个人项目的 VPS 服务器上有自己的存储库.

I could just check out the project and wait until I come in to do a check-in. Maybe that would be best. But I like to check in frequently. I'm wondering if there's some way I can keep a project in two repositories and keep them both up to date. That way I'd always be able to check in somewhere in case my HD dies. I have my own repository on a VPS server that I use for personal projects.

我调查了 svn switch 命令.使用我当前在两个存储库中的项目,我尝试将我的工作副本从个人服务器切换到工作 SVN 服务器...

I investigated the svn switch command. With my current project in both repos I tried switching my working copy from personal to work SVN servers...

$ svn switch --relocate svn+ssh://personalvps.com/svn/project/trunk svn://worksvn/project/trunk
svn: The repository at 'svn://worksvn/project/trunk' has uuid '2baef97e-42ce-488c-bbba-c2625158c643', but the WC has 'f13e1f32-dc92-4c4a-b84d-34a59fe32063'

然后我尝试添加 --username--password 参数,但收到错误提示未找到条目."

Then I tried adding the --username and --password params but got an error saying "no entry found."

这是可能的还是完全不切实际的?

Is this even possible or is it totally impractical?

更新

感谢您的回答.不幸的是,任何涉及 IT 行动的解决方案.(轻微的政策变化,改变某个地方的设置,安装一些东西)不在桌子上.我必须在当前设置中找到一个解决方案,即除了我们的 Web 服务器之外没有来自外部的连接.

Thanks for the answers. Unfortunately, any solution that involves action from I.T. (slight policy change, change a setting somewhere, install something) is not on the table. I have to find a solution within the current setup, which is no connections from outside except our Web servers.

我会看看分布式版本控制.

I'll take a look at distributed version control.

推荐答案

作为最后的努力,您始终可以使用 SSH 在您的公司防火墙中戳破一个洞.查看ssh 隧道"(而且,想想看,在防火墙中戳一个洞"也可能是一个不错的搜索词).我想你会想要 -L 或 -R ssh 选项,但我不记得哪个或者即使它们肯定是正确的.如果您正在运行 Windows,如果您先安装 Cygwin,仍然可以使用完全相同的技术.

As a last-ditch effort, you can always poke a hole in your corporate firewall with SSH. Look into "ssh tunnels" (and also, come to think of it, "poke a hole in the firewall" might be a good search term too). I think you'll want either the -L or -R ssh option, but I can't recall which or even if they're the right ones for sure. And if you're running windows, it's still possible to use the same exact technique if you install Cygwin first.

编辑:抱歉,我不太清楚这是如何工作的.您想要的选项是-R.它在远程机器上打开一个端口(用于侦听).当某些东西连接到远程机器上的那个端口时,该连接沿着 SSH 连接返回到本地机器,然后转发到本地网络中您选择的服务器.您可以在晚上离开之前使用 SSH 从您的工作计算机连接到您的家用计算机以打开隧道.然后,当您在家工作时,将 SVN 工作副本(使用 svn switch --relocate)设置为指向您的家用计算机.顺便说一句,如果您正在运行 svnserve 守护进程,SVN 端口默认为 3690.

EDIT: Sorry I wasn't more clear on how this works. The option you want is -R. It opens a port on the remote machine (for listening). When something connects to that port on the remote machine, the connection travels back down the SSH connection to the local machine, then is fowarded on to the server of your choice in the local network. You could connect to your home computer from your work computer before you leave at night with SSH to open the tunnel. Then when you're working from home, you set your SVN working copy (using svn switch --relocate) to point at your home computer. BTW, the SVN port is 3690 by default, if you're running the svnserve daemon.

这篇关于我可以在两个 SVN 存储库中拥有一个项目吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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