SVN-Git迁移:清除Git分支错误



我遵循SVN到Git的迁移指南,git svn clone运行良好,但当我运行cleanup命令时,我得到了这个错误,我甚至不确定这意味着什么。我该如何解决此问题?

java -Dfile.encoding=utf-8 -jar ~/svn-migration-scripts.jar clean-git
Could not retrieve the config for the key: svn-remote.svn.branches

当运行git svn clone命令时未指定--branches时,会出现此问题。您可以通过在执行git svn clone时指定--branches来避免它,如下所示:

git svn clone --username=ArpitAggarwal --branches=/dev --authors-file=C:/Users/ArpitAggarwal/authors.txt http://localhost:81/svn/project/branches/ dev-git

尽管如此,如果您不想指定--branches,解决方法是在.git/config中添加一个空的"branches"密钥,如下所示:

[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

对于标签的类似错误:

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

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

[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

最新更新