0

I'm using svn2git but I could use git svn as well. I had the scenario below in the SVN repository.

 trunk 
 brances 
     branchesA
         branchA1
         branchA2
         [...]
     branchesB
         branchB1
         branchB2
         [...]
     branchesX
         [...]

After the migration is done, on Git side there are branches branchesA, branchesB, etc... That have inside folders with the properly SVN branches. For example on Git repository:

 master 
 branchesA 
 branchesB 
 branchesX
 [...]

If you $git checkout branchesA you will see all branches sub folders like ($ls):

 branchA1
 branchA2
 branchA3
 [...]

Is there a way or tool or something that could fix this once I already migrated it, or somehow pass more then one folder to the --branches?

Idemax
  • 2,712
  • 6
  • 33
  • 66
  • There is PR that would fix this properly but not approved yet! https://github.com/nirvdrum/svn2git/pull/65 – Idemax Apr 25 '16 at 08:58

1 Answers1

1

Do not use git svn for a one-time conversion. It is gread if you need to constantly sync and also commit back to SVN, but sub-optimal for a one-time conversion.

There are pleny tools called svn2git, but from your question I'd guess you are not using the KDE one from https://github.com/svn-all-fast-export/svn2git. I strongly recommend using that svn2git tool. It is the best I know available out there and it's very flexible in what you can do with its rules files.

You will easily be able to configure it for your layout to get the result you want and expect. You can even keep the convention of having your branches in "subfolders" like you have it currently in SVN. A branch in Git would then be branchesA/branchA1.

If you are not 100% about the history of your repository, svneverever from http://blog.hartwork.org/?p=763 is a great tool to investigate the history of a SVN repository when migrating it to Git.

Vampire
  • 35,631
  • 4
  • 76
  • 102
  • I'm **not** using `git svn`, I'm using the `svn2git`. I checked the links and will try it out. Thanks... – Idemax Apr 25 '16 at 10:48
  • Just wanted to make sure you do not really consider it as you wrote you do consider it. And yes, you use `svn2git`, but not the one I mentioned, do you? – Vampire Apr 25 '16 at 11:15
  • Unfortunately not, I'm learning how to use the KDE. Looks easier to setup a branches layout, I just need learn how to do it... – Idemax Apr 25 '16 at 11:31
  • Probably something like https://gist.github.com/Vampire/f48bd7e3667a0cc0cbe1b5746c492be8 – Vampire Apr 25 '16 at 11:56
  • I just posted a problem in the repo, might you have a clue what's going on? https://github.com/svn-all-fast-export/svn2git/issues/3#issuecomment-214359524 – Idemax Apr 25 '16 at 14:26
  • Well yes, just read the comments why the issue was closed. Remote protocols are not supported, you have to have the repository as copy locally to use KDEs svn2git. – Vampire Apr 25 '16 at 14:30