git-svn:什么是等价于`svn switch --relocate`? [英] git-svn: what's the equivalent to `svn switch --relocate`?
问题描述
我通过 git-svn 镜像的 svn 存储库已更改 URL.
An svn repository I'm mirroring through git-svn has changed URL.
在 vanilla svn 中,您只需执行 svn switch --relocate old_url_base new_url_base
.
In vanilla svn you'd just do svn switch --relocate old_url_base new_url_base
.
我如何使用 git-svn 做到这一点?
How can I do this using git-svn?
简单地更改配置文件中的 svn url 会失败.
Simply changing the svn url in the config file fails.
推荐答案
这很好地处理了我的情况:
This handles my situation pretty well:
https://git.wiki.kernel.org/index.php/GitSvnSwitch
我使用 file://
协议进行克隆,并想切换到 http://
协议.
I cloned using the file://
protocol, and wanted to switch to the http://
protocol.
编辑 .git/config
的 [svn-remote "svn"]
部分中的 url
设置很诱人,但是这本身是行不通的.一般来说,您需要遵循以下程序:
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:
- 将 svn-remote
url
设置切换为新名称. - 运行
git svn fetch
.这需要从 svn 获取至少一个新版本! - 将 svn-remote
url
设置改回原始 URL. - 运行
git svn rebase -l
以执行本地 rebase(使用上次获取操作带来的更改). - 将 svn-remote
url
设置改回新的 URL. - 现在,
git svn rebase
应该可以再次运行了.
- 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`?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!