如何将Git repo提交到空的repo SVN服务器?

Rav*_*bra 13 git-svn

我在服务器上设置了一个空的svn,我一直在本地进行提交.现在我希望将我的repo提交到svn服务器.为此,我试过:

git-svn checkout http://remote.svn.server.com
git-svn dcommit
Run Code Online (Sandbox Code Playgroud)

Git抱怨说:

Use of uninitialized value in concatenation (.) or string at /usr/bin/git-svn line 411.
Committing to  ...
Unable to determine upstream SVN information from HEAD history
Run Code Online (Sandbox Code Playgroud)

由于我首先在我的本地计算机上启动,并且在线回购是空的,我找不到有关如何使这项工作的任何信息.

kar*_*rmi 28

我最近需要这样的东西,这个过程相对简单.

Brandon Dimcheff提供了很好的教程,"将线性git历史提交给颠覆"(替换旧的断开链接),这些步骤基于这些.

从Git 1.6.3版开始,这些步骤如下:

$ svnadmin create svn_repository
$ svn mkdir -m "Initial setup" file:///full/path/to/svn_repository/trunk

$ mkdir gitrepo && cd gitrepo
$ git init
$ echo 'Hello from Git' > file.txt
$ git add file.txt
$ git commit -m "Hello from Git"

$ git svn init --trunk=trunk file:///full/path/to/svn_repository/
$ git svn fetch

$ git branch -a # Lists remotes/trunk

$ git rebase --onto remotes/trunk --root master
# => Applying: Hello from Git etc.

$ git svn dcommit
# => Committing to ... Committed r2 ... etc
Run Code Online (Sandbox Code Playgroud)

svn checkout现在可以执行svn_repository并查看您的Git仓库.

  • 将`--log-window-size`添加到`git svn fetch`,否则在大型存储库上需要很长时间.= d (2认同)

tcu*_*rdt 6

这是我要做的:

git-svn clone http://remote.svn.server.com otherdir
Run Code Online (Sandbox Code Playgroud)

然后在其他目录中从您之前的目录本地拉出更改.然后你应该有一个通过git-svn"连接"的git repo,你应该能够使用它的dcommit.

也可能是一个有用的阅读.