svn项目同步到gitLab

安装git

确保安装了git

新建一个文件夹svn-git

在文件夹中新建userinfo.txt文件,映射svn用户,这个文件主要是用于将SVN用户映射为Git用户(昵称及其邮箱)。

userinfo.txt具体格式如下:

复制代码
admin = admin <admin@163.com>
lisi= lisi<mominglong@163.com>
lmh = lmh <lmh@163.com>
ql = ql <ql@163.com>

Clone SVN项目至本地Git

进入svn-git文件夹,右键"git Bash"打开git命令窗口,然后执行命令:

复制代码
git svn clone "svn://47.92.83.81/test-repo"  --authors-file=userinfo.txt

#切换git账号:win+r 输入control打开"用户账户"-》"管理凭据",删除git凭据
git config --global user.name "root"
git config --global user.email"admin@example.com"

git remote add origin http://39.98.166.121:9980/root/test-repo.git
#创建main分支(PS:如果报"error: src refspec main does not match any",执行)
git checkout -b main
git pull --rebase origin main
git push -u origin main

参考文档

svn 代码迁移到git_svn代码迁移到git-CSDN博客

相关推荐
_可乐无糖6 小时前
GitLab CI 脚本之 CI_COMMIT_AUTHOR
ci/cd·gitlab
_可乐无糖1 天前
GitLab CI 脚本之 dependencies 和 needs
ci/cd·gitlab
Fan_5582 天前
4核8G云服务器部署GitLab内存耗尽解决方案
gitlab
洋就在江州2 天前
gitlab-cicd 离线集成——springboot-cicd (非docker形式,shell形式)
java·spring boot·后端·ci/cd·gitlab·gitlab-runner
成为你的宁宁3 天前
【Ubuntu 18.04安装Gitlab】
ubuntu·gitlab
长春的KAKA3 天前
GitLab 项目页面报 500 错误的完整修复记录:PostgreSQL 数据库损坏、统计表缺失及数据库迁移
数据库·postgresql·gitlab
蓝胖的四次元口袋3 天前
GitLab知识梳理
gitlab
Peter(阿斯拉)5 天前
[macOS Tahoe 26]_[使用SmartSVN访问库路径报错的问题]
macos·svn·tahoe·smartsvn·macos26
inferno7 天前
SVN学习笔记(二)
笔记·学习·svn
inferno9 天前
SVN服务端下载、安装与配置(Windows版)
svn