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

查看:373
本文介绍了git-svn:与`svn switch --relocate`等价的是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通过git-svn镜像的svn仓库已经改变了URL。



在vanilla svn中,您只需执行 svn switch - -relocate old_url_base new_url_base



如何使用git-svn来做到这一点?



简单地更改配置文件中的svn url失败。 >这很好地处理了我的情况:



https://git.wiki.kernel.org/index.php/GitSvnSwitch



我使用文件进行克隆: // 协议,并希望切换到 http:// 协议。



编辑 [svn-remotesvn] 节中的 url 设置很诱人$ c> .git / config ,但它本身不起作用。一般而言,您需要遵循以下过程:


  1. 切换svn-remote url 设置为新名称。

  2. 运行 git svn fetch 。这需要从svn获取至少一个新版本!

  3. 将svn-remote url 设置更改回原始URL。 / li>
  4. 运行 git svn rebase -l <​​/ code>来执行本地rebase(使用上一次fetch操作带来的更改)。 li>
  5. 将svn-remote url 设置更改回新的URL。 现在, git svn rebase 应该再次运行。

冒险的灵魂可能会尝试 - rewrite-root


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:

  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天全站免登陆