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
.
The above git svn rebase -l
solution didn't work for me. I decided to go about it a different way:
old
and new SVN into git repo new
old
into new
cd new
git fetch ../old
git tag old FETCH_HEAD
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
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
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:
url
setting to the new name.git svn fetch
. This needs to fetch at least one new revision from svn!url
setting back to the original URL.git svn rebase -l
to do a local rebase (with the changes that came in with the last fetch operation).url
setting back to the new URL.git svn rebase
should work again.Adventurous souls may want to try --rewrite-root.