GIT Subversion Import: Subput Issue

We are currently running a large subversion repository, and I'm trying to move it to GIT. The problem is that it uses connecting lines and tags under the root directory. For example:

MyDepartment\MyOS\Project1\trunk\ <-- master branch MyDepartment\MyOS\Project1\branch\v1 <-- other branch MyDepartment\MyOS\Project1\tags\v1_20100101 <-- release tag 

There are different departments, OS and many different projects.

So, when I clone the SVN repository using -stdlayout:

 git svn clone --stdlayout http://svn-repository/ 

The clone ends up empty. Without the option, I get a clone, but then the branches are treated as directories on the main branch.

  • Is there a way to import this directory structure at a time?
  • If I write a script to import all projects separately, is there a way to combine the import of each GIT project into one large GIT repository?
+6
git svn git-svn
source share
2 answers

If I understand the question correctly, you want:

 git svn clone --trunk=MyDepartment\MyOS\Project1\trunk --tags=MyDepartment\MyOS\Project1\tags --branches=MyDepartment\MyOS\Project1\branch http://svn-repository/ 

Update: you can include more than one --branches and --tags:

 git svn clone --trunk=MyDepartment\MyOS\Project1\trunk --tags=MyDepartment\MyOS\Project1\tags --tags=MyDepartment\MyOS\Project2\tags --tags=OtherDepatment\MyOS\Project1\tags --branches=MyDepartment\MyOS\Project1\branch --branches=MyDepartment\MyOS\Project2\branch --branches=OtherDepartment\MyOS\Project1\branch http://svn-repository/ 

You cannot have more than one trunk.

Git is really designed to support one project per repository, not multiple projects in one repo. I suppose you will encounter many problems trying to use it that way.

+3
source share

Check out the git submodules . You may have to import each of your subprojects separately, but the result may slightly improve your current use.

0
source share

All Articles