将非标准的Subversion版本库转换为git [英] Converting non-standard Subversion repository to git

查看:187
本文介绍了将非标准的Subversion版本库转换为git的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个储存库,其布局是这样的:

 
躯干/
了projectA
项目B
分支机构/
了projectA-1.0
项目b-1.0
标签/
了projectA-1.0.1
项目b-1.0.1

我想将它们转换为Git仓库与躯干分离/了projectA作为顶级目录和它所有的作为的Git分支的分支。



'p>每当我尝试指定混帐SVN的init 混帐SVN的init -T主干/ -b了projectA分支-t标签HTTP ://svn.example.com ,后续的git svn的取上不同的修订神秘失败。有时候,它会一路200,有时它停止。



我现在的想法是,我要创造,反映了整个颠覆库与单个实体的Git仓库每个项目的子目录。然后,我会使用 GIT-滤波器分支来子目录重写到项目的根。



然而,我不知道如何让分支行为像我想要的那样使用 git-filter-branch 和。



此外,它是理想的创建具有不同的分支为每个项目的主干一个混帐回购协议,我会不会真的有在这种情况下,主没有问题。


我最终做的是克隆存储库的根目录,并为每个项目复制新的git repo并重新安排事情。它不干净或漂亮,但它是传统代码,我不再需要经常查看。


I have a repository whose layout is like this:

    trunk/
        projectA
        projectB
    branches/
        projectA-1.0
        projectB-1.0
    tags/
        projectA-1.0.1
        projectB-1.0.1

I want to convert them to separate git repositories with the trunk/projectA as the top-level directory and all it's branches as git branches.

Whenever I try to specify a git svn init like git svn init -T trunk/projectA -b branches -t tags http://svn.example.com, the follow-up git svn fetch fails mysteriously on different revisions. Sometimes it gets all the way to 200, sometimes it stops.

My current thinking is that I should create a git repository that mirrors the whole subversion repository as a single entity with subdirectories for each project. Then I would use git-filter-branch to rewrite the subdirectories to the root of the project.

However, I'm not sure how to get the branches to behave like I want using git-filter-branch and.

Also it would be ideal to create a single git repo that has different branches for the "trunk" of each project, I would have no problem not really having a master in this case.

解决方案

What I ended up doing was cloning the root of the repository and copying that new git repo for each project and rearranging things. It wasn't clean or pretty, but it was legacy code that I no longer need to look at very often.

这篇关于将非标准的Subversion版本库转换为git的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆