zl程序教程

您现在的位置是:首页 >  其他

当前栏目

从svn迁移至Git并保留所有 commit 记录

迁移Git 记录 所有 svn 保留 commit
2023-09-27 14:25:30 时间

用户映射文件user.txt,等号左边为svn账号,右边为Git用户名和邮箱。
注意:svn中有多少用户就要映射多少

test1=test1<147258369@qq.com>
test2=test2<246813579@qq.com>


--生成秘钥 admin@example.com为GitLab的root用户邮箱地址
ssh-keygen -t rsa -b 4096 -C "admin@example.com"

 

--查看公钥内容,将内容复制到GitLab配置中的SSH Keys
cat /root/.ssh/id_rsa.pub


--svn转换为git dsidealTest为项目名称
git svn clone https://10.10.6.175/svn/dsidealTest --no-metadata --authors-file=user.txt dsidealTest
cd dsidealTest

--添加git仓库
git remote add origin git@10.10.14.234:root/dsidealTest.git

--提交到gitlab
git push -u origin master