SVN 迁移到 GIT,并保留提交记录

1)svn账号与git账号映射

创建 user.txt ,格式如下,user.txt 放置在git base here 所选目录下即可

复制代码
schacon = Scott Chacon <schacon@geemail.com>
selse = Someo Nelse <selse@geemail.com>

为了获得 SVN 使用的作者名字列表,可使用GIT BASH 在SVN 项目下运行这个:

bash 复制代码
svn log --xml --quiet | grep author | sort -u | \
perl -pe 's/.*>(.*?)<.*/$1 = /'
2)svn转换为git
bash 复制代码
git svn clone http://ip端口/projectname --no-metadata --authors-file=user.txtt projectname

cd projectname
3)添加git仓库
bash 复制代码
 git remote add origin http://ip端口号/r/virtualSceneICV.git
4)提交到git
bash 复制代码
git push -u origin master

如果你想要将本地的master分支推送到远程仓库,并且远程的默认分支是main,你可以使用以下命令进行操作

bash 复制代码
git push -u origin master:main
相关推荐
菜萝卜子11 分钟前
【Git】GitLab 18.9 全局服务器钩子(Server Hooks)官方规范与落地实践
服务器·git·gitlab
用户11481867894841 小时前
Git Stash 丢失后的完整找回指南
前端·git
Ting.~1 小时前
GIT详解
java·笔记·git
克拉拉KLARA2 小时前
vscode禁用在git提交中插入ai coauthor copilot
git·vscode·copilot
水无痕simon3 小时前
05 Git 基础 – 查看提交历史
git
长沙红胖子Qt3 小时前
SVN培训笔记(四):使用sourceTree时,PC硬盘或者移动硬盘更换电脑后sourceTree无法拉取同步和推送已有项目管理的处理方法
svn·sourcetree管理svn·sourcetree迁移git·git svn
谢斯3 小时前
【GIT】子模块初始化与排错记录
git
遇见火星3 小时前
离线服务器时间同步NTP服务器配置
服务器·git·github
Soari4 小时前
Claude Code每日更新速览(v2.1.120-2026/04/27)-彻底摆脱 Git Bash,CI 级代码审查工具上线
git·ci/cd·bash·cluade code·ai for coding
芝士就是力量啊 ೄ೨4 小时前
如何配置Rust、Git,并从Github上拉下一个项目
git·rust·github