同样的错误。我正在将我的 SVN 存储库转换为 Git。
git version 2.8.2.windows.1
Windows 8.1 Pro 64bits, running Git For Windows 32bits.
v1,trunk地址错误,误设置为和repository root一样:
C:\Windows\system32>git svn clone https://mycompany.svn.beanstalkapp.com/myproject
--no-metadata -A c:\temp\svn_to_git_users.txt
--trunk=https://mycompany.svn.beanstalkapp.com/myproject
--tags=https://mycompany.svn.beanstalkapp.com/myproject/tags
--branches=https://mycompany.svn.beanstalkapp.com/myproject/branches
c:\code\Git_myproject
[...]
W: +empty_dir: branches/20080918_DBDEPLOY/vendor/src/csharp/MS WCSF Contrib/src/Services
W: +empty_dir: branches/20080918_DBDEPLOY/vendor/src/csharp/RealWorldControls/References
r530 = c276e3b039d8e38759c6fb17443349732552d7a2 (refs/remotes/origin/trunk)
Found possible branch point: https://mycompany.svn.beanstalkapp.com/myproject/trunk => https://mycompany.svn.beanstalkapp.com/myproject/branches/20080918_DBDEPLOY, 529
Use of uninitialized value $u in substitution (s///) at /mingw32/share/perl5/site_perl/Git/SVN.pm line 101.
Use of uninitialized value $u in concatenation (.) or string at /mingw32/share/perl5/site_perl/Git/SVN.pm line 101.
refs/remotes/origin/trunk: 'https://mycompany.svn.beanstalkapp.com/myproject' not found in ''
C:\Windows\system32>
v2 有效:更正了路径(并使用相对而不是绝对来缩短行)
C:\Windows\system32>git svn clone https://mycompany.svn.beanstalkapp.com/myproject
--no-metadata -A c:\temp\svn_to_git_users.txt --trunk=trunk
--tags=tags --branches=branches c:\code\Git_myproject
[...]
r529 = 40442d32486f4ca6f713e659b3785a446bd19de6 (refs/remotes/origin/trunk)
Found possible branch point: https://mycompany.svn.beanstalkapp.com/myproject/trunk => https://mycompany.svn.beanstalkapp.com/myproject/branches/20080918_DBDEPLOY, 529
Found branch parent: (refs/remotes/origin/20080918_DBDEPLOY) 40442d32486f4ca6f713e659b3785a446bd19de6
Following parent with do_switch
Successfully followed parent
r530 = 9fefc1b3a892555e315d55c2024cdf3d3a05010f (refs/remotes/origin/20080918_DBDEPLOY)
A src/database/sds.dbd
[...]
根据其他人的建议,我打开了配置文件(C:\code\Git_myproject.git\config),第一个版本(损坏)如下。与 v2 相比,fetch 可能是错误的(分支和标签也重复,有人说它也可能导致问题)。
[svn-remote "svn"]
noMetadata = 1
url = https://mycompany.svn.beanstalkapp.com/myproject
fetch = :refs/remotes/origin/trunk
branches = branches/*:refs/remotes/origin/*
tags = tags/*:refs/remotes/origin/tags/*
branches = branches/*:refs/remotes/origin/*
tags = tags/*:refs/remotes/origin/tags/*
第二个版本(工作)是:
[svn-remote "svn"]
noMetadata = 1
url = https://mycompany.svn.beanstalkapp.com/myproject
fetch = trunk:refs/remotes/origin/trunk
branches = branches/*:refs/remotes/origin/*
tags = tags/*:refs/remotes/origin/tags/*
查看 svn.pm,我可以看到我们在find_parent_branch()
其中输出消息"Found possible branch point"
。然后它调用
other_gs($new_url, $url, $branch_from, $r, $self->{ref_id});
which 本身调用:
Git::SVN->find_by_url($new_url, $url, $branch_from);
which 调用:
resolve_local_globs($u, $fetch, $globspec);
并且resolve_local_globs
是在第 100/101 行引发错误的地方:
my $u = (::cmt_metadata("$refname"))[0];
$u =~ s!^\Q$url\E(/|$)!! or die
我肯定在命令行中犯了一个错误,修复我的主干路径消除了错误。我从未删除配置文件中的重复行,它们在重新运行命令时自动调整。