Git svn git svn克隆失败”;致命:不是有效的对象名称;

Git svn git svn克隆失败”;致命:不是有效的对象名称;,git-svn,Git Svn,执行git svn克隆-s时https://svn.example.com/repo/我收到了以下输出: 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: Refsp

执行
git svn克隆-s时https://svn.example.com/repo/
我收到了以下输出:

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分支-a
会给出:

remotes/tags/Sync%20Controllers
remotes/tags/v1.1
remotes/trunk
remotes/v1.2

我认为问题在于“遥控器/标签/同步控制器”!=“remotes/tags/Sync%20Controllers”。

SVN上的标记中有一个空格,但git中的标记已将该空格转换为
%20
(URL编码)。要解决此问题,只需手动添加一个具有逐字命名的新标记:

cd .git/refs/remotes/tags/
mv Sync%20Controllers Sync\ Controllers
然后再次运行
git svn clone
命令


(通常您可以使用
git-tag-OLDTAG-NEWTAG
执行此操作,但git不允许我在中定义带有空格的标记。标记文件只是包含相关提交哈希的文本文件。)

您可以使用git-svn服务器端替代方案,以避免许多git-svn翻译问题

我是一名SubGit开发人员,可以说我们在解决上述字符翻译问题方面做了很多工作;在这种特殊情况下,标记将被转换为
refs/tags/Sync+Controllers
标记


另外请注意,git svn已将Subversion标记转换为分支而不是标记。

我相信空格的问题在git>=1.8.0中得到了解决(请参阅:)

所以你应该升级它

我已经对它进行了测试,它似乎在git的最新版本中工作


请参见GitHub主页:

我今天遇到了这个问题,并认为这个分支中包含的速度并不重要,我只是运行

git branch -r -d partialPayment%202.4
然后重新运行
git
svn fetch
它跳过了当前分支,并继续抓取下一个分支。

我正在使用git 1.29.2,也遇到了问题。此外,它正在运行到Windows Server 2016,git在cygwin下

正在签入
/gitmigation/.git/svn/refs/remotes/origin
,文件夹中有空格,但不是
%20
,因此没有任何更改

但是在
packed refs
中,产生问题的标记没有出现,没有名称,也没有散列

这个问题应该有另一个与产生错误的其他东西相关的问题,而不仅仅是这个

查看
/.git/config
发现了以下几行的一系列重复:

branches = server/branches/*:refs/remotes/origin/*
tags = server/tags/*:refs/remotes/origin/tags/*

每次我运行git svn克隆语句时都会生成这些代码。因此,我确实从配置文件中删除了这些内容,保存它并再次运行,但这次使用了
git svn fetch
,以防止再次获得重复的行,哇!!问题已解决。

另请参阅:相关:那里有可用的修补程序。我必须在服务器上安装SubGit还是不需要?如果我没有svn repo的管理员权限该怎么办?使用SubGit 2.0,您不必拥有存储库的管理员权限。您需要启用pre-revprop change hook来获得一个功能齐全的authors映射,但很可能它已经启用了。查看更多详细信息。我尝试了该解决方案,但出现以下错误:
致命:引用的格式无效:“refs/remotes/tags/WITH SPACE”
。如何解决这个问题?(我使用的是git版本1.8.3.msysgit.0)这对我来说很有效,文件名中有一个带有
~
字符的标记。谢谢。嗨,你知道如何解决分支机构的问题吗?可能相同,但
cd.git/refs/heads/
cd.git/logs/refs/heads/
在使用1.8.5.2时遇到了这个问题,您认为这与分支/标记名中的空格或某些特殊字符等有关吗?我在git=1.8.3.1时也看到了这个问题,svn=1.7.14和svn2git=2.3.2与svn分支名称中的空格有关。我有git版本2.23.0,刚刚遇到这个问题