git svn fetch - 会话 URL 与预期会话 URL 不匹配

git svn fetch - Session URL does not match expected session URL

我尝试在托管 svn 服务器的 ubuntu 机器上执行 git svn fetch。 (将 svn repo 转移到 git)git svn 响应错误:

Session URL does not match expected session URL: Repository moved permanently to 'http://localhost/svn/repo' at /usr/share/perl5/Git/SVN.pm line 148.

我可以通过浏览器访问 svn 存储库:

svn co http://localhost/svn/repo/trunk 也有效。

我的 git 存储库的配置如下所示:

[svn-remote "svn"]
    url = http://localhost/svn/repo
    fetch = trunk:refs/remotes/origin/trunk
    branches = branches/branchA/*:refs/remotes/branchA/*

去年我做了完全相同的过程,没有任何问题。错误消息应该告诉我什么?

GIT_TRACE=1:

07:30:19.957480 git.c:576               trace: exec: git-svn fetch
07:30:19.957508 run-command.c:646       trace: run_command: git-svn fetch
06:30:20.264901 git.c:344               trace: built-in: git rev-parse --git-dir
06:30:20.270689 git.c:344               trace: built-in: git rev-parse --show-cdup
06:30:20.280345 git.c:344               trace: built-in: git config --bool --get svn.useSvmProps
06:30:20.282850 git.c:344               trace: built-in: git config --get svn.ignorerefs
06:30:20.284977 git.c:344               trace: built-in: git config --bool --get svn.uselogauthor
06:30:20.289744 git.c:344               trace: built-in: git config --int --get svn.logwindowsize
06:30:20.296912 git.c:344               trace: built-in: git config --get svn.repackflags
06:30:20.302913 git.c:344               trace: built-in: git config --bool --get svn.parent
06:30:20.308843 git.c:344               trace: built-in: git config --bool --get svn.noMetadata
06:30:20.313303 git.c:344               trace: built-in: git config --get svn.authorsprog
06:30:20.315443 git.c:344               trace: built-in: git config --bool --get svn.fetchall
06:30:20.325453 git.c:344               trace: built-in: git config --get svn.configdir
06:30:20.327644 git.c:344               trace: built-in: git config --int --get svn.repack
06:30:20.336702 git.c:344               trace: built-in: git config --get svn.includepaths
06:30:20.339225 git.c:344               trace: built-in: git config --get svn.username
06:30:20.341358 git.c:344               trace: built-in: git config --bool --get svn.localtime
06:30:20.350228 git.c:344               trace: built-in: git config --bool --get svn.useSvnsyncProps
06:30:20.352446 git.c:344               trace: built-in: git config --bool --get svn.nocheckout
06:30:20.361053 git.c:344               trace: built-in: git config --get svn.authorsfile
06:30:20.365090 git.c:344               trace: built-in: git config --get svn.ignorepaths
06:30:20.367110 git.c:344               trace: built-in: git config --bool --get svn.followparent
06:30:20.376769 git.c:344               trace: built-in: git config --get svn.revision
06:30:20.378979 git.c:344               trace: built-in: git config --bool --get svn.addauthorfrom
06:30:20.384743 git.c:344               trace: built-in: git config --bool --get svn.noauthcache
06:30:20.389012 git.c:344               trace: built-in: git config --bool --get svn.quiet
06:30:20.391455 git.c:344               trace: built-in: git rev-parse --symbolic --all
06:30:20.444247 git.c:344               trace: built-in: git rev-parse --git-path svn
06:30:20.453089 git.c:344               trace: built-in: git config -l
06:30:20.465201 git.c:344               trace: built-in: git config -l
06:30:20.468112 git.c:344               trace: built-in: git config --bool svn.useSvmProps
06:30:20.474744 git.c:344               trace: built-in: git config -l
Session URL does not match expected session URL: Repository moved permanently to 'http://localhost/svn/repo' at /usr/share/perl5/Git/SVN.pm line 148.

查找我的虚拟机的旧版本。正确的 git 配置应如下所示:

[svn-remote "svn"]
    url = file:///localhost/svn/repo  # <-  instead of http://
    fetch = trunk:refs/remotes/origin/trunk
    branches = branches/branchA/*:refs/remotes/branchA/*

希望这能防止有一天人们浪费时间...