Hi,
We have some troubles with moving and old svn repositories to git by the help of SVN Mirror.
Firstly our old working directory structure in below;
Project---
----Folder1
----Folder2
----Folder3
---x
---y
---trunk
----Folder4
---x
---y
---trunk
And our plan to move all the content and trunks/folder in one single git repository with project level.
Automatic configuration need the selection of trunk and doesn’t allow project level trunk selection.
Can we handle this problem with manual configuration and absolutely how?
Hello Fatih,
I’ve edited your post to use Markdown to make the repository structure more clear.
But still I don’t understand what you mean by “all content trunks/folder”. If you clarify this, maybe I’ll be able to propose certain configuration.
For now I’ll give you an example of manual configuration that could help. Maybe by analogy you’ll find out how to compose manual configuration for your case.
Suppose, you want the following:
Project---
----Folder1 (do not translate to Git)
----Folder2 (do not translate to Git)
----Folder3
---x (do not translate to Git)
---y (do not translate to Git)
---trunk (translate to Git)
---branches (translate to Git branches under this directory if they will be created in SVN in the future)
---... (translate to Git)
---tags (translate to Git tags under this directory if they will be created in SVN in the future)
---... (translate to Git)
----Folder4
---x (do not translate to Git)
---y (do not translate to Git)
---trunk (translate to Git)
---branches (do NOT translate to Git)
---tags (do NOT translate to Git) future)
i.e. translate to Git only Foder3’s trunk/branches/tags AND Folder4/trunk but nothing else.
This can be accomplished with the following configuration:
url = <URL of "Project" directory>
trunk = Folder3/trunk:refs/heads/master
branches = Folder3/branches/*:refs/heads/*
tags = Folder3/tags/*:refs/tags/*
branches = Folder4/trunk:refs/heads/folder4-trunk
and optionally you can add
shelves = Folder3/shelves/*:refs/shelves/*
if you want shelves support.
If you want some other directories to be translated, you can add more “branches=” rules. I hope you get the idea.
Hi @dmitry.pavlenko ,
Actually, our main problem is about manuel configuration. Single directory or automatic options are works well but in manual configuration branches and tags are didn’t map. But we need manual configuration for collect all the data and move into single git branches/repositories include tags and branches in subversion.
Also,
We want to move all history and all folders in subversion repository with all the data (branches etc.) in single git repo.
Thanks for attention, sincerely yours,
Fatih
Hello Fatih,
sorry, from you message I don’t understand if you need further assistance or was my example clear enough for you to extend the idea to your particular case.
If you still need assistance, describe where your trunk/branches/tags are, schematically if possible. In other words, what’s the structure of your repository. Then probably I’ll propose mapping configuration that would work for your case.
In the first message you didn’t mention branches and didn’t specify what are ‘x’ and ‘y’, what’s their structure and where you want them to be translated in git. So probably it would be the best if you prepare a detailed version of a picture from your first post.
Hi @dmitry.pavlenko sorry for situtation, this might be related to my problem. Actually I have a several svn repository and each of them are different.
On the other hand maybe it could be the version of subversion we use svn 1.6.
And let me clarify,
PROJECT
–Folder1
-branches (Folder 1)
-tags(Folder1)
-trunk(Folder1)
-somestuff(Folder1)
–Folder2
-branches(Folder2)
-tags(Folder2)
-trunk(Folder2)
-weirdfolder(Folder2)
–Folder3
-tags(Folder3)
-trunk(Folder3)
-branches(Folder3)
–Folder4
-branches
-trunk
–Folder5
–tags(ProjectLevel)
–branches(ProjectLevel)
–releases(ProjectLevel)
We want to move all data with one git repo if possible with true manual configuration.
Thanks a lot.
I’ve formatted your message a bit:
PROJECT
--Folder1
-branches (Folder 1)
-tags(Folder1)
-trunk(Folder1)
-somestuff(Folder1)
--Folder2
-branches(Folder2)
-tags(Folder2)
-trunk(Folder2)
-weirdfolder(Folder2)
--Folder3
-tags(Folder3)
-trunk(Folder3)
-branches(Folder3)
--Folder4
-branches
-trunk
--Folder5
--tags(ProjectLevel)
--branches(ProjectLevel)
--releases(ProjectLevel)
Here’s my version of configuration:
#ProjectLevel part:
#If you don't have project-level trunk, it won't be created, but it's better to set 'master' so some existing branch, not necessary trunk
trunk = trunk:refs/heads/master
branches = branches/*:refs/heads/*
branches = releases/*:refs/heads/releases/*
tags = tags/*:refs/tags/*
#Folder1 part:
branches = Folder1/trunk:refs/heads/folder1/trunk
branches = Folder1/branches/*:refs/heads/folder1/*
branches = Folder1/somestuff:refs/heads/folder1/somestuff
#or alternatively, depending on the structure
#branches = Folder1/somestuff/*:refs/heads/folder1/somestuff/*
tags = Folder1/tags/*:refs/tags/folder1/*
#Folder2 part:
branches = Folder2/trunk:refs/heads/folder2/trunk
branches = Folder2/branches/*:refs/heads/folder2/*
branches = Folder2/weirdfolder:refs/heads/folder2/weirdfolder
#or alternatively, depending on the structure
#branches = Folder2/weirdfolder/*:refs/heads/folder2/weirdfolder/*
tags = Folder2/tags/*:refs/tags/folder2/*
#Folder3 part:
branches = Folder3/trunk:refs/heads/folder3/trunk
branches = Folder3/branches/*:refs/heads/folder3/*
tags = Folder3/tags/*:refs/tags/folder3/*
#Folder4 part:
branches = Folder4/trunk:refs/heads/folder4/trunk
branches = Folder4/branches/*:refs/heads/folder4/*
#Folder5 part:
#if you mean everything together to a single branch, then e.g.
branches = Folder5:refs/heads/folder5/all
#othwise, by analogy with other FolderX
If your have different SVN repositories under different URLs (i.e. not just Folders of the same URL), it is not possible to unite them together to the same Git repository with SVN Mirror. But if you mean just different Folders under the same root, this is the example of how to do that.
I hope you get the idea and can adjust my example to your use case.