使用 Git 和以 Git 为中心服务器的 SVN
我的公司使用 Git 进行版本控制,但我们正在与另一家使用 SVN 的公司合作一个项目(他们拒绝使用 Git)。我需要将 Git 服务器设置为中央服务器,并以某种方式提供对它的 SVN 访问。我知道 git-svn 非常适合使用 Git,而 SVN 是中央服务器,但如何提供 SVN 对 Git 存储库的访问权限?
注意:我看到 Github 现在提供对其 Git 存储库的 SVN 访问。有谁知道他们是怎么做到的?
My company uses Git for version control but we are working on a project with another company that uses SVN (they refuse to use Git). I need to set up our Git server as the central server and somehow provide SVN access to it. I know git-svn works great for using Git while SVN is the central server, but how do I provide SVN access to a Git repository?
Note: I saw that Github is now providing SVN access to their Git repositories. Does anyone know how they do it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我能想到的一个粗略的方法是在你的网络中设置一个 svn 存储库,使用 git-svn 从那里签出,添加你真正的 git 存储库作为远程,拉从那里推入 svn 远程。我不知道它是否有效或可靠,但它应该会产生某种镜子。您可以使用一些在推送更新 SVN 镜像时启动的挂钩来同步。至于相反的方式(当您的客户提交到 SVN 存储库时),您必须为此考虑其他方法。
A crude way I can think of is to setup an svn repository inside your network, checkout from there using
git-svn
, add your realgit
repo` as a remote, pull from there and push into the svn remote. I don't know if it'll work or is reliable but it should produce some kind of a mirror. You can your side of it in sync using some of the hooks that get kicked in when a push occurs to update the SVN mirror. As for the other way around (when your clients commit to the SVN repository), you'll have to think of something else for that.是的,您可以使用 SubGit:
创建空的 SVN 存储库
将其配置为使用 SubGit 与您的 Git 存储库链接:
开始持续同步:
两者SVN 和 Git 接口将变得可读可写。
据我所知,GitHub 使用了另一种方法:他们实现了一个可以即时访问 Git 的 SVN 接口。该方法有其自身的优点和缺点。
Yes, you can use SubGit:
Create empty SVN repository
Configure it to link with your Git repository using SubGit:
Start continuous synchronization:
Both SVN and Git interfaces will be readable and writable as result.
GitHub uses another approach, as I know: they implemented an SVN interface that accesses the Git on-the-fly. The approach has its own advantages and drawbacks.
好吧,我将用一个糟糕但可行的答案来回答我自己的问题(imo)。我可以使用标准补丁文件在我们两家公司之间发送更改。我的经理认为这是一个可以接受的解决方案,但我真的不喜欢它
编辑:为了回应Noufal Ibrahim,我认为通过使用 Tailor 与钩子脚本相结合,我实际上可能拥有一个可能真正起作用的自动化解决方案。 此博客有一个关于使用 Tailor 设置 SVN 镜像的精彩描述。
Ok, I'm going to answer my own question with a bad, but feasible, answer (imo). I can use standard patch files to send changes between our two companies. My manager believes this is an acceptable solution, but I really don't like it
EDIT: In response to Noufal Ibrahim, I think that by using Tailor in combination with hook scripts I might actually have an automated solution that might actually work. This blog has a great description for using Tailor to set up an SVN mirror.