我正在努力解决以下问题.当我继续从SVN获取修订版时
git svn fetch
我收到以下错误:
Found possible branch point: https://somecompany.com/product/trunk
=> https://somecompany.com/product/branches/deep/branches/product-001, 72666 
Found branch parent: (refs/remotes/deep/branches/product-001) b685b7b92813885fdf 6b8e2663daf884bf504b14
Following parent with do_switch 
Successfully followed parent 
error: 'refs/remotes/deep' exists; cannot create 'refs/remotes/deep/branches/product-001'
fatal: Cannot lock the ref 'refs/remotes/deep/branches/product-001'.
update-ref -m r72667 refs/remotes/deep/branches/product-001 df51920e8f0a53f26507 c2679eb6a9dbad91e0d6: command returned error: 128
发生这种情况是因为我使用SVN分支的默认过滤器获取修订:
[svn-remote "svn"]
    url = https://somecompany.com/someproduct
    fetch = trunk:refs/remotes/trunk
    branches = branches/*:refs/remotes/*
    tags = tags/*:refs/remotes/tags/*
现在,我添加了下面的行,但为时已晚:
branches = branches/deep/branches/*:refs/remotes/deep/branches/*
我试图通过使用git svn reset来删除所有提交来解决这个问题.实际上我可以从错误消息中看到git正在尝试正确的事情,但不能因为分支遥控/深层存在.
我试图搜索2个可能的解决方案:1.删除该分支(遥控器/深),但由于它被git作为遥控器跟踪,我无法找到任何解决方案.2.删除与该分支相关的整个历史记录.也没有成功:(
有人知道如何处理我的问题吗?
我终于能够通过执行以下两个步骤来解决该问题:
但仍然存在获取问题。我需要使用
branches = branches/*:refs/remotes/*
对于普通分支和
branches = branches/deep/branches/*:refs/remotes/deep/branches/*
对于深枝。不幸的是,前一个规范包含了后者,所以我收到错误“致命:无法锁定引用'refs/remotes/deep'”,因为 git-svn 尝试根据第一个规范创建深层分支。
到目前为止,我通过手动注释第一个“分支”并获取具有深层分支的特定修订来做到这一点,但这不是一个好的选择,因为这两种情况都有太多的修订需要获取。
UPD:对于剩下的问题,我找到了简单但不优雅的解决方案。我使用分支来指定深层分支的路径,并使用获取来指定第一级的每个分支。