【发布时间】:2011-10-08 20:19:37
【问题描述】:
一段时间以来,我已经成功使用 git-svn 连接到我的 svn 主干。我最初通过这样做来设置我的仓库:
git svn clone -s http://domain.com/svn/name-of-repo
我已经设置了很长一段时间(可能接近一年)并且没有遇到任何问题,很可能是因为我所做的一切都在本地 git 分支上,我最终合并回我的主分支,并提交回 svn 主干。
最近,我需要开始将一些更改提交到同一个 svn 存储库中的另一个分支,http://domain.com/svn/name-of-repo/branches/demo。
通过编辑我的 .git/config 文件并添加以下行,我能够从该分支获取一次:
[svn-remote "svndemo"]
url = http://domain.com/svn/name-of-repo/branches/demo
commiturl = http://domain.com/svn/name-of-repo/branches/demo
fetch = :refs/remotes/git-svn-demo
然后我运行以下命令来获取演示分支,从修订版 4034 开始:
git svn fetch svndemo -r 4034
所以现在我有一个名为 remotes/git-svn-demo 的新远程分支。从中我创建了一个功能分支:
git checkout -b svndemo-local remotes/git-svn-demo
这抓住了我需要的东西,所以我做了我必须做的更改,提交到我的本地分支,然后尝试运行“git svn fetch && git svn rebase”。两者都返回错误:
无法从工作树历史中确定上游 SVN 信息
这就是我卡住的地方。我环顾了 SO 和其他网站(Google),但除了“git-svn clone the repo, and start over”之外没有找到解决方案,这并不理想。
我查看了我的 .git/svn/refs/remotes/git-svn-demo/unhandled.log 并将其与我的 .git/svn/refs/remotes/trunk/unhandled.log 进行了比较,但什么也没有他们有很大的不同。
我还查看了从这个远程分支的初始获取中传下来的提交消息,其中包含 git-svn-id 信息。
blah blah blah,这是提交信息,blah blah blah
git-svn-id:http://domain.com/svn/name-of-repo/branches/demo@4034e6edf6fb-f266-4316-afb4-e53d95876a76
我很想听听关于这个的新想法。
【问题讨论】: