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博客

相关推荐
深度学习04079 小时前
SVN 独立服务端部署与客户端使用指南(CentOS/Rocky 9.5 + Windows)
windows·svn
惜年_night10 小时前
Docker部署05-GitLab的CI-CD发布
ci/cd·docker·gitlab
无人生还别怕1 天前
搭建gitlab服务并接入openldap认证
git·gitlab·github·openldap·ldap·统一认证
*_潇_*2 天前
0095__日常--记一次gitlab Runner配置与CI/CD环境搭建流程
ci/cd·gitlab
hrw_embedded2 天前
svn架构下研发与产线异地办公程序共享问题?
svn·内网穿透http·研发与产线
开发者联盟league3 天前
在ubuntu上使用apt方式安装gitlab
linux·ubuntu·gitlab
张小凡vip3 天前
gitlab的ci配置文件yaml参数说明
git·ci/cd·gitlab
田里的水稻3 天前
OE_gitlab服务操作和维护方法
分布式·gitlab
puamac4 天前
GitLab CI/CD 指南
gitlab
Rain5094 天前
GitLab-Runner + AI 代码审查服务 + 远程大模型 全套部署运维实战
linux·运维·人工智能·python·ci/cd·gitlab·ai编程