git svn无法创建跟随svn分支的分支
我正在努力解决以下问题。当我继续从SVN获取修订时git svn无法创建跟随svn分支的分支,git,git-svn,Git,Git Svn,我正在努力解决以下问题。当我继续从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/pro
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正在尝试正确的事情,但不能,因为存在分支remotes/deep
我试图寻找两种可能的解决方案:
1.删除该分支(remotes/deep),但由于git将其作为远程对象跟踪,因此我无法找到任何解决方案。
2.删除与该分支相关的整个历史记录。也没有成功:(
有人知道如何处理我的问题吗?我终于能够通过执行以下两个步骤来解决问题:
branches = branches/*:refs/remotes/*
对于正常分支和
branches = branches/deep/branches/*:refs/remotes/deep/branches/*
不幸的是,前一个规范包含了后一个规范,所以当git svn试图根据第一个规范创建深分支时,我得到了错误“致命:无法锁定ref'refs/remotes/deep'”
到目前为止,我通过手动注释第一个“分支”并获取具有深分支的特定修订来实现这一点,但这不是一个好的选择,因为两种情况下都有太多的修订需要获取
UPD:我已经找到了解决剩余问题的简单但不优雅的解决方案。我正在使用分支指定深度分支的路径,并使用fetch指定第一级的每个分支。我遇到了一个非常类似的问题,发现“git svn reset”,而不是“git reset”修复了它。如果您事先不更新分支配置,那么一旦检索到通过分支点的提交,您就必须进行备份以再次检索它们。否则,它们将在没有父级的情况下悬空 所以,像以前一样更新分支,然后运行
git svn reset -r<revisionnum>
git svn重置-r
然后像往常一样使用git svn获取。这节省了我很多时间从svn重建整个东西
在您的情况下,您可能还需要调查“忽略”不跟踪嵌入式分支的功能。事实上,当我指的是git svn resetAbout 1.从打包的refs中删除refs/remotes/deep 2.删除.git/logs/refs/remotes/deep时,我错误地写了git reset。您能解释一下怎么做吗?由rm或del完成,具体取决于您使用的操作系统