0

I have a bunch of commits applied to SVN repository, now I need to move them to git repository. I was thinking of applying the commits one by one using patches, but those patches use relative path that differs in both repositories, e.g. /trunk/project/src/main/java/... in svn and /project/src/main/java/... in git is there a way to create patches that have relative path to src/main, not trunk/project/src....

user2508615
  • 213
  • 2
  • 16

4 Answers4

0

I wanted to add this as a comment but I do not have 50 reputation points, oh well. I believe the answer to your question can be found here:

How to migrate SVN repository with history to a new Git repository?

Community
  • 1
  • 1
neo
  • 161
  • 5
0

You should use svn clone

git svn clone <SVN_REPOSITORY_URL>

Kamafeather
  • 8,663
  • 14
  • 69
  • 99
0

git svn doesn't work for me, it fails with some nasty errors: /usr/lib/perl/.... So I figured this issue the following way using IntelliJ IDEA:

  1. apply patches one by one
  2. in apply patch window I changed the folder hierarchy for each file in the initial commit
  3. changed the folder to the git folder.

But this approach is time-consuming

bahrep
  • 29,961
  • 12
  • 103
  • 150
user2508615
  • 213
  • 2
  • 16
  • I would suggest to try solving the *perl* error. Probably could be something easily to solve. And will let you to play with the *Power of Git* ;) – Kamafeather Aug 27 '14 at 13:13
  • I've already solved my issue, hope these explanations would help someone else. If I had 1000+ commits I would have digged into those perl errors, in current implementation git svn doesn't seem a reasonable approach to me. – user2508615 Aug 27 '14 at 13:52
0

Have you try svn2git? It's really a powerful tool based on git-svn. I have moved lots of svn repos to git repos using it. You may have a try to see if the perl error is still there.

Landys
  • 7,169
  • 3
  • 25
  • 34