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

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

test1=test1<[email protected]>
test2=test2<[email protected]>


--生成秘钥 [email protected]为GitLab的root用户邮箱地址
ssh-keygen -t rsa -b 4096 -C "[email protected]"

--查看公钥内容,将内容复制到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 [email protected]:root/dsidealTest.git

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

猜你喜欢

转载自www.cnblogs.com/kgdxpr/p/10717390.html