如何正确使用git-svn,svn-ers checkout svnrepo和git-ers clone gitrepo,不小心犯下错误 [英] How to use git-svn properly, svn-ers checkout svnrepo and git-ers clone gitrepo, committing carelessly

查看:139
本文介绍了如何正确使用git-svn,svn-ers checkout svnrepo和git-ers clone gitrepo,不小心犯下错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的公司,我们使用SVN,但希望将来无缝切换到GIT。这就是为什么我开始学习git-svn,它可以作为svn仓库的前端。



我试图在以下设置中使用它:




  • SVNREPO - 主svn库

  • GITREPO - SVNREPO的git-svn克隆
  • REPO1,REPO2,... - GITREPO代表git-ers的git克隆



要求如下:



$ ul
$ [ManyGitUsers] 许多giters可以从/ push到GITREPO克隆
  • [ManySvnUsers] 许多svner提交给SVNREPO

  • [SyncHook] GITREPO和SVNREPO之间的同步可以通过钩子完成,或者在开发钩子之前由管理员手动完成

  • [NoInteraction] giters不想知道任何关于SVNREPO的信息,反之亦然

  • [NoProactivity] 用户解决所有问题(冲突)他们不与其他人同步以避免他们


    问题:


    1. 这个设置是否可以用git-svn?建议其他如果有更好的一个

    2. 我应该如何配置GITREPO?

    3. 请问giters是否需要知道特殊的后端,或者一切都是透明的?

    到目前为止,我的实验表明它 与git同步的可能性。我只是认为,原因是我发布了糟糕的命令......

    解决方案

    我不认为这可以长期和会导致问题。



    首先让我谈谈如何完成svn镜像:

    通常情况下,掌握回购和奴隶回购(通常在不同的地点,因此需要)。 svner,在主位置结账并由主人提交。那些在奴隶位置结账和提交在奴隶。但实际的设置是,每当有人提交镜像时,从服务器的提交首先被提交给主服务器,然后镜像回从服务器(svnsync)。最终用户不知道这一点。这可以确保回购处于同步状态。有关此设置的更多解释: http://www.tty1.net /blog/2007-08-26-subversion-proxy_en.html



    现在,引入Git会变得困难。事情是,可以在Git仓库和SVN仓库中同时进行提交。如果SVN中的提交被应用并且新的提交来自Git(它没有在SVN中看到新的提交),那么您将遇到很多麻烦。



    您可以设置的是所有用户使用 git-svn 直接克隆svn repo。然后他们可以像使用其他svn客户端一样使用git repo。

    或者像你提到的那样有一个中心的git repo(clone with git-svn),并且所有的gite从中克隆并推送到它。从中央仓库有一个钩子到 git svn rebase git svn dcommit ,但是当事情破裂时,有一个手动修复回购。


    In my company we use SVN, but want to seamlessly switch to GIT in future. That's why I started to learn git-svn, which promises to serve as a frontend for svn repository.

    I tried to use it with following setup:

    • SVNREPO - the master svn repository
    • GITREPO - git-svn clone of SVNREPO
    • REPO1,REPO2,... - git clones of GITREPO representing git-ers

    The requirements are:

    • [ManyGitUsers] many giters can clone from/push to GITREPO
    • [ManySvnUsers] many svners commit to SVNREPO
    • [SyncHook] synchronization between GITREPO and SVNREPO can be done by hook, or manually by admin before the hook is developed
    • [NoInteraction] giters don't want to know anything about SVNREPO and vice versa
    • [NoProactivity] users solve all problems (conflicts) when they happen; they don't sync with others to avoid them

    Questions:

    1. Is this setup possible with git-svn ? Suggest other if there is a better one
    2. How should I configure the GITREPO ?
    3. Will giters need to be aware of the special backend, or is everything transparent ?

    So far, my experiments showed that it moreless works, but commit into SVNREPO breaks the possibility to synchronize with git. I just believe that the reason is me issuing bad commands...

    解决方案

    I don't think this can in long term and will cause problems.

    First let me talk about how svn mirroring is done:

    Usually, there is a master repo and a slave repo ( at different locations generally, hence the need). The svners, at master location checkout and commit from master. The ones at slave location checkout and commit at slave. But the actual setup is that whenever someone commits to the mirror, the commit at slave is first committed to the master and then mirrored back to slave ( svnsync). The end user is not aware of this. This makes sure that the repos are in sync. More explanation on this setup: http://www.tty1.net/blog/2007-08-26-subversion-proxy_en.html

    Now, bring in Git, it becomes difficult. The thing is, there can be near simultaneous commits in bot the Git repo and the SVN repo. If the commit in SVN gets applied and the new commit comes in from Git ( which had not seen the new commit in SVN), you will be in whole lot of trouble.

    The setup you can have is that all the users use git-svn to "clone" the svn repo directly. They can then use the git repo like any other svn client.

    Or there is a central git repo like you mentioned ( clone with git-svn) and all the giters clone from it and push to it. There is a hook to git svn rebase and git svn dcommit from the central repo, but when things break, some one manually fixes the repo.

    这篇关于如何正确使用git-svn,svn-ers checkout svnrepo和git-ers clone gitrepo,不小心犯下错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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