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

相关推荐
z.q.xiao16 小时前
【镜像模式】WSL如何访问windows内网服务
linux·网络·windows·gitlab·wsl·dns
github.com/starRTC1 天前
Claude Code中英文系列教程17:将Claude Code集成在GitLab工作流里面
git·gitlab·github
阿凡达蘑菇灯2 天前
git安装--gitlab操作
git·gitlab
凉云生烟3 天前
cpolar助力Grafana告别局域网束缚!让数据监控触手可及
服务器·网络·信息可视化·gitlab·内网穿透
shimly1234563 天前
为公司服务器配置 gitlab CI/CD
gitlab
小舞O_o3 天前
gitlab文件上传
linux·服务器·git·python·目标检测·机器学习·gitlab
长沙红胖子Qt4 天前
SVN培训笔记(二):使用sourceTree通过git桥接管理svn项目
git·svn·sourcetree·sourcetree管理svn
Snower_20224 天前
CentOS 7 搭建 SVN 服务器(精简版教程)
linux·运维·服务器·svn·centos
墨笔之风5 天前
Linux (Docker环境)GitLab本地部署指南
linux·docker·gitlab
筑梦之路5 天前
gitlab相关记录——筑梦之路
gitlab