问题描述
在执行git svn clone -s https://svn.example.com/repo/
时,我收到以下输出:
Whilst doing git svn clone -s https://svn.example.com/repo/
I received the following output:
r3073 = a6132f3a937b632015e66d694250da9f606b8333 (refs/remotes/trunk)
Found possible branch point: https://svn.example.com/repo/trunk => https://svn.example.com/repo/branches/v1.3, 3073
W: Refspec glob conflict (ref: refs/remotes/trunk):
expected path: repo/branches/trunk
real path: repo/trunk
Continuing ahead with repo/trunk
W: Refspec glob conflict (ref: refs/remotes/trunk):
expected path: repo/branches/trunk
real path: repo/trunk
Continuing ahead with repo/trunk
W: Refspec glob conflict (ref: refs/remotes/trunk):
expected path: repo/branches/trunk
real path: repo/trunk
Continuing ahead with repo/trunk
W: Refspec glob conflict (ref: refs/remotes/trunk):
expected path: repo/branches/trunk
real path: repo/trunk
Continuing ahead with repo/trunk
fatal: Not a valid object name refs/remotes/tags/Sync Controllers
cat-file commit refs/remotes/tags/Sync Controllers: command returned error: 128
运行git branch -a
给出:
remotes/tags/Sync%20Controllers
remotes/tags/v1.1
remotes/trunk
remotes/v1.2
我认为问题是"remotes/tags/Sync Controllers"!="remotes/tags/Sync%20Controllers".
I think the problem is that "remotes/tags/Sync Controllers" != "remotes/tags/Sync%20Controllers".
推荐答案
SVN上的标记中有一个空格,但是git中的标记已将此空间转换为%20
(URL编码).要解决此问题,只需手动添加一个带有原词名称的新标签:
The tag on SVN has a space in it, but the tag in git had this space converted to %20
(URL encoded). To solve it just manually add a new tag with the verbatim name:
cd .git/refs/remotes/tags/
mv Sync%20Controllers Sync\ Controllers
然后再次运行git svn clone
命令.
(通常您会使用git tag OLDTAG NEWTAG
进行此操作,但是git不允许我定义一个带空格的标记.标记文件只是包含相关提交的哈希值的文本文件.)
(Normally you'd do this with git tag OLDTAG NEWTAG
but git was not allowing me to define a tag with a space in. The tag files are simply text files containing the hash of the relevant commit.)
这篇关于git-svn克隆失败“致命:无效的对象名称";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!