Nikhil Khurana
Nikhil Khurana

Reputation: 422

Migrate multiple projects from SVN to Git

I have multiple projects (around 20) which are dependent on each other. Currently each project has it's own SVN repository. Now I jave planned to migrate to Git. There are two approaches : 1. To have a separate Git repository for each project. 2. To have a one repository that contains all projects so that it's easy for someone to checkout and make changes.

I have decided to go with the second one using svn2git. I am still confused how to start with this. Also, I need to retain the entire history of commits which were made to a project. It's easy to do that for one single project with svn2git tool but how do I approach for this.

Upvotes: 1

Views: 782

Answers (1)

Obsidian
Obsidian

Reputation: 3897

If you want to gather multiple distinct projects under a single banner, you probably want to consider using :

git submodule

… to register distinct Git sub-repositories under a big one, corresponding to the whole project as well as storing some additional stuff (Documentation, tools, glu and middle-third utilities…). This will allow you, in addition of this, to individually push them onto their own remote repositories if needed and enable users to clone only the ones they need.

If, hovewer, you plan to merge all these projects with their history into a single application, then it's not really a svn2git problem : you need to solve a lot of things before, starting with the fact that all these projects will share a single tree (as well as the working directory) and potentially present conflicts.

If this is really what you want to do anyway, you may use :

git subtree

… and import each of them inside its own subtree among a common repository, then proceed to the merging of each branch into to master one. But I recommend not considering git subtree at first without really understanding what it's for and how it works. It's not dangerous, but it's not meant neither to be the normal way of using git.

Upvotes: 2

Related Questions