问题描述
通过git-svn镜像的svn仓库已经改变了URL。
在vanilla svn中,您只需执行 svn switch - -relocate old_url_base new_url_base
。
如何使用git-svn来做到这一点?
简单地更改配置文件中的svn url失败。 >这很好地处理了我的情况:
我使用文件进行克隆: //
协议,并希望切换到 http://
协议。
编辑 [svn-remotesvn]
节中的 url
设置很诱人$ c> .git / config ,但它本身不起作用。一般而言,您需要遵循以下过程:
- 切换svn-remote
url
设置为新名称。 - 运行
git svn fetch
。这需要从svn获取至少一个新版本! - 将svn-remote
url
设置更改回原始URL。 / li>
- 运行
git svn rebase -l 来执行本地rebase(使用上一次fetch操作带来的更改)。 li>
- 将svn-remote
url
设置更改回新的URL。 现在,git svn rebase
应该再次运行。
- 将svn-remote
冒险的灵魂可能会尝试。
An svn repository I'm mirroring through git-svn has changed URL.
In vanilla svn you'd just do svn switch --relocate old_url_base new_url_base
.
How can I do this using git-svn?
Simply changing the svn url in the config file fails.
This handles my situation pretty well:
https://git.wiki.kernel.org/index.php/GitSvnSwitch
I cloned using the file://
protocol, and wanted to switch to the http://
protocol.
It is tempting to edit the url
setting in the [svn-remote "svn"]
section of .git/config
, but on its own this does not work. In general you need to follow the following procedure:
- Switch the svn-remote
url
setting to the new name. - Run
git svn fetch
. This needs to fetch at least one new revision from svn! - Change the svn-remote
url
setting back to the original URL. - Run
git svn rebase -l
to do a local rebase (with the changes that came in with the last fetch operation). - Change the svn-remote
url
setting back to the new URL. - Now,
git svn rebase
should work again.
Adventurous souls may want to try --rewrite-root
.
这篇关于git-svn:与`svn switch --relocate`等价的是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!