RW Access git repository using svn (git-svnserver)?

后端 未结 4 1619
忘了有多久
忘了有多久 2020-12-25 14:59

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 all

相关标签:
4条回答
  • 2020-12-25 15:38

    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.

    0 讨论(0)
  • 2020-12-25 15:41

    This is Python code to serve a git repository over svn protocol:

    http://git.q42.co.uk/git_svn_server.git

    0 讨论(0)
  • 2020-12-25 15:45

    I believe the git-svn link is meant to be driven by git (to monitor -- rebase or dcommit -- a SVN branch).
    Meaning you could first clone whatever git repo you need on your local server (where you also use SVN), and use that for 'git-svn' commands between your local Git repo and your SVN workspace.

    Once your local Git repo reflects adequately your SVN repo, you can push back to the remote Git server.

    0 讨论(0)
  • 2020-12-25 15:57

    SVNGit is exactly what you want. It is an opensource servlet library for SVN clients to access Git repositories.

    0 讨论(0)
提交回复
热议问题