首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >git-svn问题

git-svn问题
EN

Stack Overflow用户
提问于 2009-11-11 12:12:45
回答 3查看 7.6K关注 0票数 4

可以克隆一个有多个版本的git存储库吗?我们尝试这样做,在第1000次提交后,它执行GC并退出,使克隆处于不可用状态。

代码语言:javascript
运行
复制
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:~#

尝试通过再次键入该命令来继续检出将导致以下结果:

代码语言:javascript
运行
复制
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
EN

回答 3

Stack Overflow用户

回答已采纳

发布于 2009-11-17 07:11:07

找到了答案。在使用ubuntu附带的git版本时,一定存在某种bug。以下行在新创建的.git/config文件中出现两次:

代码语言:javascript
运行
复制
svn-remote.svn.fetch=:refs/remotes/git-svn
svn-remote.svn.fetch=:refs/remotes/git-svn

删除重复项后,我可以键入一个似乎正在继续结帐的git svn fetch

票数 5
EN

Stack Overflow用户

发布于 2009-11-11 12:29:36

这在我身上发生了很多次。我只是重新运行了一次完全相同的git命令,它从它停止的地方继续运行。最终它走到了尽头,一切都正常了。

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

票数 2
EN

Stack Overflow用户

发布于 2009-11-11 12:28:11

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

代码语言:javascript
运行
复制
$ 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

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

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/1712956

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档