SVN-Git迁移:clean-git分支错误

bla*_*ird 5 svn git version-control git-svn

我正在关注SVN到Git的迁移指南,git svn clone很好但是当我运行清理命令时我得到了这个错误,我甚至不确定这意味着什么.我该如何解决这个问题?

java -Dfile.encoding=utf-8 -jar ~/svn-migration-scripts.jar clean-git
Could not retrieve the config for the key: svn-remote.svn.branches
Run Code Online (Sandbox Code Playgroud)

Arp*_*wal 8

如果未--branches在运行git svn clone命令时指定,则会出现此问题.你可以通过指定--brancheswhile执行git svn clone如下来避免它:

git svn clone --username=ArpitAggarwal --branches=/dev --authors-file=C:/Users/ArpitAggarwal/authors.txt http://localhost:81/svn/project/branches/ dev-git
Run Code Online (Sandbox Code Playgroud)

仍然如果您不想指定--branches,解决方法是添加一个空"branches".git/config,如下所示:

[core]
    repositoryformatversion = 0
    filemode = false
    bare = false
    logallrefupdates = true
    symlinks = false
    ignorecase = true
    hideDotFiles = dotGitOnly
[svn-remote "svn"]
    url = http://localhost:81/svn/project/branches
    branches = 
[svn]
    authorsfile = C:/Users/ArpitAggarwal/authors.txt
Run Code Online (Sandbox Code Playgroud)

对于标签的类似错误:

无法检索密钥的配置:svn-remote.svn.tags

添加一个空"tags".git/config,如下所示:

[core]
        repositoryformatversion = 0
        filemode = false
        bare = false
        logallrefupdates = true
        symlinks = false
        ignorecase = true
        hideDotFiles = dotGitOnly
    [svn-remote "svn"]
        url = http://localhost:81/svn/project/branches
        branches = dev/*:refs/remotes/origin/*
        tags =  
    [svn]
        authorsfile = C:/Users/ArpitAggarwal/authors.txt
Run Code Online (Sandbox Code Playgroud)