1

I have a number of SVN projects:

/home/me/code/projectA 
(points to http://myserver.com/svn/projectA/trunk - has two branches: branch1 and branch2)  
/home/me/code/projectB 
(points to http://myserver.com/svn/projectB/trunk - has two branches: branch3 and branch4) 

I want to migrate them to Git in a hierarchical project structure where master_project is the git root:

/home/me/code/master_project/.git
/home/me/code/master_project/projectA
/home/me/code/master_project/projectB

I want to preserve the original commit history for projectA and projectB. I don't care about revision numbers. I will not need the SVN projects any more once I perform this migration, so I am not worrying about somehow keeping the flow of changes coming in from SVN to this new Git repo. It's a straight up import.

Any ideas as to the best way of doing this?

Is it possible to keep branches branch1 and branch3 as branches in the Git repo?

Kyle L.
  • 315
  • 2
  • 6
  • I think I would suggest you import all the repositories to individual git repositories; Then from there use [git submodules](http://git-scm.com/book/en/Git-Tools-Submodules) to checkout a version of your child repos to the parent. Some people consider this to have the caveat that you must specifically advance the version references for the child. That means that whenever you commit to the child and you want that in the parent, you have to make a commit to the master that tells it to use the newer child version. I personally think this works well, you can work directly in the child projects – ThorSummoner Aug 10 '14 at 03:10

1 Answers1

1

Each svn repo should be its own git repo.
You can then group those repos either with:

If you are using svn2git, or a more robust tool like subgit, you will keep the branches after import.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250