RW使用svn访问git仓库(git-svnserver)? [英] RW Access git repository using svn (git-svnserver)?

查看:151
本文介绍了RW使用svn访问git仓库(git-svnserver)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有一个程序可以完成git-svn的功能,但是在服务器上的存储库是git的情况下,开发人员使用svn?



我知道github.com允许svn访问他们托管的git仓库,但是看起来他们并没有发布这个项目的开源代码(但是?) ,使用他们的服务器不是我的选择(甚至不是他们的私人存储库)。

编辑:我认为我在寻找的是与'git-cvsserver'并行的 - git-svnserver。在一些搜索中,我在git邮件列表中发现了一些2 - 3年前的线程,但它看起来并没有任何人取得重大进展。我希望有人能纠正我。



有没有任何git-svnserver项目正在进行中?我讨厌重复工作,但似乎 GitHub是最远的,但没有其他人可以拥有它。

SubGit是服务器端解决方案,它允许Subversion访问Git存储库,反之亦然。您可以参考文档获取更多详细信息,但通常使用 SubGit 非常简单: p>

SubGit需要本地访问您要推送的Git存储库。在同一台机器上创建Subversion版本库:

  $ svnadmin create $ SVN_REPOS 

然后运行

  $ subgit configure $ SVN_REPOS 

该命令创建 $ SVN_REPOS / conf / subgit.conf 文件,调整其 git.default.repository 选项,如下所示:

  [gitdefault] 
repository = /path/to/your/git/repository.git

您可以指定许多同步到单个Subversion存储库的Git存储库,只需添加必要的 [gitidentifier] 部分。

您还可以指定任意的资源库布局,例如标准的一个看起来像这样:
$ b $ pre $ code> trunk = trunk:refs / heads / master
ranches = branches / *: refs / heads / *
shelfs = shelves / *:refs / shelves / *
tags = tags / *:refs / tags / *

您也可以调整 $ SVN_REPOS / conf / authors.txt 来将svn作者姓名映射到git身份。 p>

运行后:

  $ subgit install $ SVN_REPOS 
$ ...让初始翻译完成...
$翻译成功

此刻你有不断同步的Subversion版本库和它的Git对应版本,即SubGit立即将svn修订版翻译成每个 svn commit 上的git commit,并且在每个<$ c上git commit svn revision $ c> git push 。



因此,您可以对创建的Subversion存储库提交更改,并将所有更改与主Git存储库保持同步。


Is there a program that does what git-svn does, but in a situation where the repository on the server is git, and the developer uses svn?

I know that github.com allows svn access to the git repositories they host, but it doesn't look like they've released this project open source (yet?), and using their servers is not an option for me (not even their private repositories).

EDIT: I think what I am looking for is a parallel to 'git-cvsserver' -- git-svnserver. In a bit of searching, I found some 2-3 year old threads on the git mailing list, but it doesn't look like anyone has made significant progress. I hope someone can correct me on that.

Are there any git-svnserver projects currently underway? I'd hate to have duplicate effort, but it seems that GitHub is the farthest along, but nobody else can have it.

解决方案

Take a look at SubGit.

SubGit is server-side solution, it enables Subversion access to Git repository and vice versa. You may refer to documenation for more details, but in general it is fairly easy to use SubGit:

SubGit needs local access to Git repository you're pushing to. Create Subversion repository on the same machine:

    $ svnadmin create $SVN_REPOS

then run

    $ subgit configure $SVN_REPOS

This command creates $SVN_REPOS/conf/subgit.conf file, adjust its git.default.repository option just as follows:

    [git "default"]
    repository = /path/to/your/git/repository.git

You can specify many Git repositories synced to single Subversion repository, just add necessary [git "identifier"] sections.

You can also specify arbitrary repository layout, e.g. the standard one looks like this:

    trunk = trunk:refs/heads/master
    branches = branches/*:refs/heads/*
    shelves = shelves/*:refs/shelves/*
    tags = tags/*:refs/tags/*

You can also adjust $SVN_REPOS/conf/authors.txt to map svn author names to git identities.

After that run:

    $ subgit install $SVN_REPOS
    $ ... let initial translation complete ... 
    $ TRANSLATION SUCCESSFUL

At this moment you have Subversion repository and its Git counterpart which are continuously synchronized, i.e. SubGit immediately translates svn revision into git commit on every svn commit and git commit into svn revision on every git push.

So, you can commit changes to created Subversion repository and keep all changes in sync with the main Git repository.

这篇关于RW使用svn访问git仓库(git-svnserver)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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