git-svn问题

时间:2009-11-11 04:12:45

标签: git git-svn

是否可以克隆具有多个修订版的git存储库?我们试图这样做,并且在第1000次提交之后它执行GC并退出,使克隆处于不可用状态。

r998 = a5cb4f6a377b0ca80cd95d73b0e32f0552b9cdfd (git-svn)
M   trunk/asdf/asdf.java
r999 = a87b06ae8aa497bb28c294b7ff8668ce2e4c8fcc (git-svn)
D   tags/sdafasdf/asdfasdf.java
r1000 = 20b383d138499eee4f121079ae059458f3facc94 (git-svn)
Auto packing your repository for optimum performance. You may also
run "git gc" manually. See "git help gc" for more information.
Counting objects: 18103, done.
Compressing objects:  61% (10590/17116)      7116)   
Compressing objects: 100% (17116/17116), done.
Writing objects: 100% (18103/18103), done.
Total 18103 (delta 9301), reused 0 (delta 0)
Removing duplicate objects: 100% (256/256), done.
root@host:~#

再次输入命令尝试继续结帐会产生以下结果:

root@host:~/repo# git svn clone https://host/svn/repo
Remote ref refs/remote/git-svn is tracked by
  "svn-remote.svn.fetch=:refs/remotes/git-svn"
and
  "svn-remote.svn.fetch=:refs/remotes/git-svn"
Please resolve this ambiguity in your git configuration file before continuing

3 个答案:

答案 0 :(得分:5)

解决了问题。使用ubuntu附带的git版本时必定存在某种错误。以下行在新创建的.git / config文件中出现两次:

svn-remote.svn.fetch=:refs/remotes/git-svn
svn-remote.svn.fetch=:refs/remotes/git-svn

删除副本允许我输入git svn fetch,似乎正在继续结帐。

答案 1 :(得分:1)

是。它应该工作得很好。我使用以下命令克隆了Mono项目存储库(超过140k版本):

$ mkdir mono
$ cd mono
$ git init
$ git svn init svn+ssh://foo@mono-cvs.ximian.com/source
$ git config svn-remote.svn.fetch trunk/mono:refs/remotes/git-svn/trunk
$ git config svn-remote.svn.branches branches/*/mono:refs/remotes/git-svn/branches/*
$ git config svn-remote.svn.tags tags/*/mono:refs/remotes/git-svn/tags/*
$ git fetch git://repo.or.cz/mono.git refs/heads/master:refs/remotes/git-svn/trunk refs/heads/branches/*:refs/remotes/git-svn/branches/* refs/tags/*:refs/remotes/git-svn/tags/*
$ git reset --hard git-svn/trunk

一切都很顺利。这与你正在做的相似吗?

答案 2 :(得分:1)

这对我来说很重要。我只是再次重新运行完全相同的git命令,它从它停止的地方继续。最终它到了最后,一切正常。

修改:如果在运行git svn clone ...时出现此问题,则您需要在重新运行命令时将clone替换为fetch