我看到 git svn fetch 重复检索同一个 Subversion 当它在我的 Subversion 存储库中找到分支时进行修订。我们是 使用标准的 Subversion 存储库布局,具有顶层 /trunk、/tags 和/branches 目录(以及 git 存储库 使用“git svn init -s”创建)。但是,有问题的分支是 通常从主干内的子目录复制,而不是 行李箱。
git svn fetch 的输出通常是这样的:
r2537 = d5b22e956157af036d4112e42e8fb927e45758c8 (trunk) M Enterprise/VC/libgc/SymbolVenue.cpp r2538 = cfed4ca0491da0b732f32bfff72ba678450a0915 (trunk) Found possible branch point: http://repo/prod_repos/trunk/Enterprise/VC => http://repo/prod_repos/branches/file_conversion, 2523 W: Refspec glob conflict (ref: refs/remotes/scripter@832): expected path: branches/scripter@832 real path: trunk/Enterprise/Python Continuing ahead with trunk/Enterprise/Python W: Refspec glob conflict (ref: refs/remotes/trunk): expected path: branches/trunk real path: trunk Continuing ahead with trunk Initializing parent: file_conversion@2523 A gc/QuoteService.cpp A gc/TestSuite.h A gc/quote_svc.pro A gc/QuoteService.h ..... r1 = d349ed8cb2d76596fe2b83224986275be4600fad (QuoteSvcFix442@2698) D gc/FixMessageLogger.h ..... r5 = r19 = r20 = .....
然后我们回到修订版 1。 git svn fetch then 继续获取修订,直到到达修订 创建了分支。
我做错了什么?无论如何我要告诉 git svn fetch 到 不检索它已经撤回的修订?
最佳答案
我注意到这个问题是因为我得到了同样的错误信息:
W: Refspec glob conflict (ref: refs/remotes/trunk):
expected path: branches/trunk
real path: trunk
原来 .git/config 有重复的行,这似乎混淆了 git-svn,像这样:
[svn-remote "svn"]
...
branches = project/branches/*:refs/remotes/*
tags = project/tags/*:refs/remotes/tags/*
branches = project/branches/*:refs/remotes/*
tags = project/tags/*:refs/remotes/tags/*
删除那些重复项为我解决了奇怪的 git-svn 行为,对你来说可能也是如此。我不确定是什么导致 git-svn 首先复制此信息。我杀死并继续最初的克隆,这可能是相关的?
关于git svn fetch 为分支多次检索相同的 Subversion 修订版,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1140428/