How do I import an svn repository with a changing directory structure to git?
I have an svn repository where the original structure looked something like:
features/
trunk/
branch1/
But then over time moves to the standard svn stru开发者_JAVA百科cture of:
trunk/
branches/
tags/
etc.
Is there any way for svn2git or git svn to work with this? Alternatively, is there any way to re write svn history in a non-destructive way so that the repo has the default structure from the start?
It feels like I'm going to have to do this manually (i.e. identify the revisions where the directories change structure and write scripts that apply changes up to those point with a certain structure, and repeat until I have the whole history in the git repo).
That doesn't sound like much fun at all. HELP!
You can try making several git-svn clones, one for each period of a certain structure. Then grafting them together. I've got a fairly simple example of this here:
http://blog.tfnico.com/2010/10/gitsvn-6-grafting-together-svn-history.html
You might want to look at svn.borg.ch/svndumptool/ for getting the repository into a better layout.
Use the following git-svn commands,
migrate one time (git to svn)
- git svn clone (your-svn-repo-URL) --stdlayout
- cd (your-project-folder)
- git init
- git remote add origin (your-git-repo-URL)
- git add .
- git commit
Migrate git to svn two-way sync
Using following commands to proceed with crontab,
- git svn fetch
- git svn rebase
- git svn dcommit
精彩评论