codekoala
codekoala

Reputation: 725

git-svn after an SVN repository is moved?

We recently moved our SVN server from one data center to another, and the IP of the server has changed. I used svn switch --relocate old_url new_url to update my actual working copy, and that was happy.

However, I do most of my work in a local git version of the repository (using git-svn, obviously). After moving the SVN server, I updated the URL for the repo in .git/config, but when I try to use dcommit, I receive this error:

Unable to determine upstream SVN information from HEAD history.
Perhaps the repository is empty. at /home/me/libexec/git-core/git-svn line 520.

What am I missing?

Upvotes: 5

Views: 2788

Answers (2)

Ben Challenor
Ben Challenor

Reputation: 3395

It's possible to do this with git-svn by cloning both repos, merging them, then rebuilding the git-svn metadata.

See my answer here.

Upvotes: 0

Dan Moulding
Dan Moulding

Reputation: 220583

In general, this isn't something that git-svn supports directly. The biggest hurdle is that git-svn uses the "git-svn-id" (visible in the commit log for each commit) to uniquely identify commits from SVN -- and the SVN URL is part of this ID. If the URL changes, it pretty much invalidates all of your existing history.

There are workarounds described here which look like they should work, but they aren't exactly simple and I haven't tried any of them myself.

Upvotes: 4

Related Questions