Git-svn 拒绝在 svn 存储库上创建分支错误:“不在同一存储库中”
我正在尝试创建 svn 分支使用 git-svn。 该存储库是使用 --stdlayout
创建的。 不幸的是,它生成一个错误,指出“源和目标似乎不在同一个存储库中”。 该错误似乎是由于源 URL 中未包含用户名而导致的。
$ git svn Branch foo-as-bar -m "尝试将 Foo 变成 Bar。"
将 r1173 处的 svn+ssh://my.foo.company/r/sandbox/foo/trunk 复制到 svn+ssh://[电子邮件受保护]/r/sandbox/foo /branches/foo-as-bar...
尝试使用不受支持的功能:源和目标似乎不支持 位于同一个存储库中(src: 'svn+ssh://my.foo.company/r/sandbox/foo/trunk'; 目的地: 'svn+ssh://[电子邮件受保护]/r/sandbox/foo/branches/foo-as-bar') 在 /home/me/.install/git/libexec/git-core/git-svn 第 610 行
我最初认为这只是一个配置问题,检查 .git/config
没有任何建议不正确。
[svn-remote "svn"]
url = svn+ssh://[email protected]/r
fetch = sandbox/foo/trunk:refs/remotes/trunk
branches = sandbox/foo/branches/*:refs/remotes/*
tags = sandbox/foo/tags/*:refs/remotes/tags/*
我正在使用 git 版本 1.6.3.3 。
谁能解释为什么会发生这种情况,以及如何最好地解决它?
I am attempting to create a svn branch using git-svn. The repository was created with --stdlayout
. Unfortunately it generates an error stating the "Source and dest appear not to be in the same repository". The error appears to be the result of it not including the username in the source url.
$ git svn branch foo-as-bar -m "Attempt to make Foo into Bar."
Copying svn+ssh://my.foo.company/r/sandbox/foo/trunk at r1173 to
svn+ssh://[email protected]/r/sandbox/foo/branches/foo-as-bar...Trying to use an unsupported feature: Source and dest appear not to
be in the same repository (src:
'svn+ssh://my.foo.company/r/sandbox/foo/trunk';
dst:
'svn+ssh://[email protected]/r/sandbox/foo/branches/foo-as-bar')
at /home/me/.install/git/libexec/git-core/git-svn line 610
I intially thought this was simply a configuration issue, examination of .git/config
doesn't suggest anything incorrect.
[svn-remote "svn"]
url = svn+ssh://[email protected]/r
fetch = sandbox/foo/trunk:refs/remotes/trunk
branches = sandbox/foo/branches/*:refs/remotes/*
tags = sandbox/foo/tags/*:refs/remotes/tags/*
I am using git version 1.6.3.3
.
Can anyone shed any light on why this might be occuring, and how best to address it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
对此问题的实际修复位于此补丁中,可从 邮件列表线程:
请注意,对于 Danny 使用的同一版本 1.6.3.3,我在 588 处找到了该特定行。在 Ubuntu Karmic 中9.10,这个脚本是
/usr/lib/git-core/git-svn
。An actual fix for this is in this patch, obtained from the mailing list thread:
Note that for the same revision that Danny's using, 1.6.3.3, I found this specific line at 588. In Ubuntu Karmic 9.10, this script is
/usr/lib/git-core/git-svn
.我认为这是 git-svn 中的一个错误,如果您观察错误中的源存储库,它会丢失 url 的 svnuser@ 部分。 这是因为 git-svn 使用提交消息中的 svn 存储库? 我不知道。 我能够通过修改 git-svn perl 脚本以包含第 609 行上的硬编码 url 来使其工作。在您的情况下,第 609 行看起来像这样...
$src = "svn+ssh://[电子邮件受保护]/r/sandbox/foo/trunk";
请注意,如果您的 git-svn 比我的新/旧,这可能会有所不同。 在我成功分支后,我删除了该行(因为我只需要分支两次。)我将提交错误报告。
另请注意,如果您使用非 svn+ssh 类型的存储库,例如 file:////home/r/sandbox/foo/trunk,这不是问题。
I think this is a bug in git-svn, if you observe the source repository in the error it is missing the svnuser@ portion of the url. This is because git-svn uses the svn repo from the commit messsage? Im not sure. I was able to make it work by modifying git-svn perl script to include the hardcoded url on line 609. In your case line 609 would look something like this...
$src = "svn+ssh://[email protected]/r/sandbox/foo/trunk";
Note this may be different if your git-svn is newer/older then mine. After i successfully branched I removed the line ( since i only needed to branch twice. ) Im going ot file a bug report.
Also note if you are using non svn+ssh type repo's.. such as file:////home/r/sandbox/foo/trunk this isnt an issue.