git-svn: what's the equivalent to `svn switch --relocate`?

后端 未结 8 531
深忆病人
深忆病人 2020-11-29 17:40

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.

8条回答
  •  迷失自我
    2020-11-29 18:40

    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.

提交回复
热议问题