svn 迁移git并保留commit历史记录,以及所有branch

一、说明:

1,原仓库为SVN,新的仓库为gitlab


二、目标:

1,将所有SVN仓库包括commit,branch全部迁移至gitlab


注释:本次迁移只迁移仓库,账号未进行迁移


三、开始迁移 

1,先保证有git客户端 ,安装省略


2,从SVN拉取代码到并转为git

    git svn clone   http://xxxx.com/repos/dev/occ   


3, 关联远程仓库

    cd  occ

    git remote add origin http:/xxxxxxr/occ.git 或者

    git remote add origin git@xxxxxxr/occ.git


4,在gitlab新建仓库 保证仓库为新建,没有任何提交


5,提交gitlab 并保留所有commit ,branch

   git push -u origin master


猜你喜欢

转载自blog.51cto.com/douya/2480005