Svn & # 8594; git with multiple trunks / branches / tags

I have a single SVN repository with the following current structure:

  • project1
    • branches
    • trunk
    • tags
  • project2
    • branches
    • trunk
    • tags

which originally had this structure:

  • Project
    • branches
    • Trunk
      • proj1
      • proj2
    • tags

Thus, the project was divided into two separate "subrepositories" (or whatever you want to name)

Is there any way to port this to git without losing history ? Would svn2git be better than git-svn for this scenario? Is there any other migration tool?

EDIT : I tried git svn clone as suggested, but as I thought it did not follow the transition from the old structure to the new one. He only imported changes from the new structure.

+4
source share
5 answers

First I converted the main trunk to git:

git svn clone url-to-project -s 

Then I converted each project:

 git svn clone url-to-project1 -s git svn clone url-to-project2 -s ... 

Then, for each project, I attached the previous story to the main highway using grafts and a filter branch.

I just talked about it .

+3
source

svn2git just uses “git svn” at the bottom, so it won’t be “better” as such. It just makes beautiful tags and branches and clears things for a clean break from svn. If this is what you want, I would go and use it in two subrepositories separately. He will receive all the relevant story.

+2
source

Have you tried the built-in

 git svn clone 

git-svn

0
source

Your “current” structure already has the whole story from the previous structure. Thus, cloning each project using git svn clone should work fine.

No need to tell Git about the previous structure with multiple projects in the trunk directory.

The great thing about Git is that you can try the migration as many times as you like until you are satisfied with the result.

0
source

Use git svn clone -s SVN_REPOS to git clone the Subversion repository, assuming a standard Subversion layout. You will get a local git branch named master, but git branch -a will show you all the remote branches. Subversion branches will only have a branch name, but tags will have the branch name tags/tag_name .

Do not reuse branch / tag names with local cloning! git doesn't like it.

This guide has helped me a lot.

http://www.viget.com/extend/effectively-using-git-with-subversion/

0
source

All Articles