git-svn:什么是等价于`svn switch --relocate`? [英] git-svn: what's the equivalent to `svn switch --relocate`?

查看:32
本文介绍了git-svn:什么是等价于`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:

  1. 将 svn-remote url 设置切换为新名称.
  2. 运行git svn fetch.这需要从 svn 获取至少一个新版本!
  3. 将 svn-remote url 设置改回原始 URL.
  4. 运行 git svn rebase -l 以执行本地 rebase(使用上次获取操作带来的更改).
  5. 将 svn-remote url 设置改回新的 URL.
  6. 现在,git svn rebase 应该可以再次运行了.
  1. Switch the svn-remote url setting to the new name.
  2. Run git svn fetch. This needs to fetch at least one new revision from svn!
  3. Change the svn-remote url setting back to the original URL.
  4. Run git svn rebase -l to do a local rebase (with the changes that came in with the last fetch operation).
  5. Change the svn-remote url setting back to the new URL.
  6. Now, git svn rebase should work again.

喜欢冒险的人不妨试试--重写根.

Adventurous souls may want to try --rewrite-root.

这篇关于git-svn:什么是等价于`svn switch --relocate`?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆