0

Last week, I converted our svn repository to git, which took about 4 days to run. Our initial plan was to run the script during the weekend and switch to git on monday, but due to the size of our repository this proved to be impossible.

We're now thinking about keeping the test-run online and just adding the latest svn commits to the git, but I'm running into some problems. I don't have that much experience with either, so all of the commands I found were thanks to SO and Google.

The last commit that was converted to git was 69488 so I would have to get every commit since 69489. The first thing I did was (thank to this thread):

git svn clone -r69489 svn-repo
cd repo
git svn rebase

But now I'm pretty much stuck. The logical next step (in my head) seems to be to tell the new local git repo where the remote bitbucket repository is and merge the two:

git remote add origin bitbucket-path
git pull origin master
git push origin master

But when I do this, I get merge conflicts that can't be automatically resolved, which seems strange to me since git should know what to do... Am I missing something or am I going to have to go through a ton of files manually to remove the conflicts?

Community
  • 1
  • 1

1 Answers1

1

You don't have to do anything special. Just do a git svn init ... && git svn fetch ... for the initial import. After that you can call git svn rebase, which just adds the new commits to the git repository.

Slaven Rezic
  • 4,571
  • 14
  • 12
  • `git svn fetch` takes ages to run for our repository, which is what we're trying to avoid. Is there any way to do the same, but only for the last n revisions? I was able to download these through `git svn clone -rN`, but I can't seem to be able to commit these changes to the git repo. – Ivo van der Veeken Aug 28 '13 at 08:12
  • 1
    You call `git svn fetch` only _once_. The last revisions will be fetched by `git svn rebase` and this is usually fast. – Slaven Rezic Aug 28 '13 at 10:16
  • That's what I did, but it starts from scratch every time. The script I found converted the svn to git without leaving any svn folders or references. Could that be the reason it starts from r1 every time? Like I said, I'm very new to this. Thanks for the help. – Ivo van der Veeken Aug 28 '13 at 12:36
  • I'm going to redo the conversion for our smallest repo and not delete .git/svn/, since that's probably what's causing this. I'll get back to you :) – Ivo van der Veeken Aug 28 '13 at 12:50
  • Got it!! To anybody with the same problem: don't remove the .git/svn/ folder and especially don't use the --no-metadata when cloning the repo. – Ivo van der Veeken Aug 28 '13 at 13:26