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

后端 未结 8 528
深忆病人
深忆病人 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:38

    The above git svn rebase -l solution didn't work for me. I decided to go about it a different way:

    1. Clone old SVN repo into git repo old and new SVN into git repo new
    2. Fetch old into new
      • cd new
      • git fetch ../old
      • git tag old FETCH_HEAD
    3. Rebase new on top of old (should succeed because the trees in the root of new and the tip of old are identical)
      • git checkout master (Assumes that the master branch is pointing at the SVN head. This will be the case with a clean clone; otherwise dcommit before you start.)
      • git rebase --root --onto old
    4. Rebuild the git-svn metadata of new to account for the rebase
      • git update-ref --no-deref refs/remotes/git-svn master (adjust the remote ref depending on how you cloned, e.g. it could be refs/remotes/svn/trunk)
      • rm -r .git/svn
      • git svn info

提交回复
热议问题