How to Convert Subversion Repo to Git

时间:2022-10-07 19:29:05

用了比较长时间的 SVN,但现在新的项目都采用Git。之前的项目又不得不维护,那么能不能将项目从SVN迁移到Git呢。答案是肯定的,网上的方案是 git-svn,或者更高级的封装 svn2git。

方法其实很明确,导出SVN的历史数据,建立新的Git Repo。但是在实际操作中遇到了一些问题,且在这里记录一下。这次的操作环境是Windows。

1. git-svn只支持通过网络连接(svn:// 或 http://之类)的方式来转换

这样的话,其实比较麻烦,需要提供网络形式的连接方式。一些小项目就是本地建的repo。

git.exe svn clone "file:///D:/Repositories/thirdparty"  "F:\Working\CXX\thirdparty-test" -T trunk -b branches -t tags

Initialized empty Git repository in f:/Working/CXX/thirdparty-test/.git/
Couldn't open a repository: Unable to open an ra_local session to URL: Unable to open repository 'file:///D:/Repositories/thirdparty': Expected FS format '2'; found format '4' at /usr/lib/perl5/site_perl/Git/SVN.pm line 310 git did not exit cleanly (exit code 1) (2344 ms @ 2013/8/17 10:11:08)

  

2. 利用TortoiseSVN自带的svnserve.exe来提供svn://连接方式

D:\Repositories>"E:\Progs\TortoiseSVN\bin\svnserve.exe" -t -r D:\Repositories
( success ( 2 2 ( ) ( edit-pipeline svndiff1 absent-entries commit-revprops depth log-revprops atomic-revprops partial-replay ) ) )
D:\Repositories>"E:\Progs\TortoiseSVN\bin\svnserve.exe" -i -r D:\Repositories
( success ( 2 2 ( ) ( edit-pipeline svndiff1 absent-entries commit-revprops depth log-revprops atomic-revprops partial-replay ) ) ) D:\Repositories>"E:\Progs\TortoiseSVN\bin\svnserve.exe" -i --listen-port 3690 -r D:\Repositories
( success ( 2 2 ( ) ( edit-pipeline svndiff1 absent-entries commit-revprops depth log-revprops atomic-revprops partial-replay ) ) )
D:\Repositories>"E:\Progs\TortoiseSVN\bin\svnserve.exe" -i --listen-port 13690 -r D:\Repositories
( success ( 2 2 ( ) ( edit-pipeline svndiff1 absent-entries commit-revprops depth log-revprops atomic-revprops partial-replay ) ) )
D:\Repositories>"E:\Progs\TortoiseSVN\bin\svnserve.exe" -d --listen-port 13690 -r D:\Repositories

之前一直连不上,出现下面的错误:

svn Connection refused at /usr/lib/perl5/site_perl/Git/SVN.pm line 310

利用-d选项后,可以实现正常访问。

3. 转换之后,可以将这个repo推到仓库中。

参考链接:

https://code.google.com/p/support/wiki/ConvertingSvnToGit

How to Convert Subversion Repo to Git的更多相关文章

  1. convert svn repo to git

    https://john.albin.net/git/convert-subversion-to-git 1. 抓取Log 在linux 上做的,其余是在win上做的. 2. svn co svn:/ ...

  2. repo 和git的用法

    1. 服务器版本下载: repo init -u git@192.168.1.11:i700t_60501010/platform/manifest.git-b froyo_almond -m M76 ...

  3. repo+manifests+git方式管理安卓代码

    repo+manifests+git方式管理安卓代码 1.repo的获取 repo只是google用Python脚本写的调用git的一个脚本,主要是用来下载.管理Android项目的软件仓库.(也就是 ...

  4. 发布 Rafy 源码到 GitHub

      最近项目组开始使用 Git 来作为源码管理.我今天就顺便把 Rafy 的源码也迁移到了 github 上,方便大家使用.这是项目的地址:https://github.com/zgynhqf/raf ...

  5. Git - Tutorial [Lars Vogel]

    From: http://www.vogella.com/tutorials/Git/article.html Git - Tutorial Lars Vogel Version 5.6 Copyri ...

  6. Git - Tutorial官方【转】

    转自:http://www.vogella.com/tutorials/Git/article.html#git_rename_branch Lars Vogel Version 5.8 Copyri ...

  7. Subversion/Git/ReviewBoard工作流程

    根据My (work)Git Workflow进行修改,在 Windows下进行测试,http://mojodna.net/2009/02/24/my-work-git-workflow.html 目 ...

  8. How to get started with GIT and work with GIT Remote Repo

    https://www.ntu.edu.sg/home/ehchua/programming/howto/Git_HowTo.html#zz-7. 1.  Introduction GIT is a ...

  9. gitlab & gerrit & git & repo & jenkins

    Omnibus GitLab documentation(中文安装说明) 在自己的服务器上部署 GitLab 社区版->较为全面 GIT & REPO & GERRIT (三) ...

随机推荐

  1. Swift中的willSet与didSet

    Swift中的willSet与didSet 周银辉 在Swift语言中用了willSet和didSet这两个特性来监视属性的除初始化之外的属性值变化 无需说太多,看看下面的代码你就能很快明白的 imp ...

  2. Git创建ssh-key

    打开git bash界面,输入: ssh-keygen -t rsa -C "yourname@email.com" 一路回车,后续保持默认值即可. 把C:\users\yourn ...

  3. 边工作边刷题:70天一遍leetcode: day 86-1

    Find Median from Data Stream 要点: 基本框架:两个heap:large,small把所有数二分.一个新的element.目标:维持heap中的元素个数相同.错误理解:新元 ...

  4. Android 通用流行框架大全

    1. 缓存 DiskLruCache    Java实现基于LRU的磁盘缓存 2.图片加载 Android Universal Image Loader 一个强大的加载,缓存,展示图片的库 Picas ...

  5. ZK框架的分析与应用

    前言:本文是在下的在学习ZK官方文档时整理出来的初稿.本来里面有很多的效果图片和图片代码的.奈何博客园中图片不能粘贴上去,所以感兴趣的筒子们就将就吧.内容中,如有不好的地方,欢迎斧正! ZK框架的分析 ...

  6. 18.Llinux-触摸屏驱动(详解)

    本节的触摸屏驱动也是使用之前的输入子系统 1.先来回忆之前第12节分析的输入子系统 其中输入子系统层次如下图所示, 其中事件处理层的函数都是通过input_register_handler()函数注册 ...

  7. 22.一个球从100m高度*下落,每次落地后返跳回原高度的一半,再反弹。求它在第10次落地时,共经过多少米,第10次反弹多高。

    #include <stdio.h> #include <stdlib.h> int main() { ,hn=sn/; int i; ;i<=;i++) //注意i是从 ...

  8. IntelliJ快捷键笔记

    1.查找文件:Ctrl+Shift+N 2.大小写转换:Ctrl+Shift+U 3.get/set方法快捷键:Alt+Insert 4. 查看类继承关系:Ctrl+H或者Ctrl+Shift+Alt ...

  9. cdoj第13th校赛初赛F - Fabricate equation

    http://acm.uestc.edu.cn/#/contest/show/54 F - Fabricate equation Time Limit: 3000/1000MS (Java/Other ...

  10. Spring boot ---- java&period;lang&period;NoClassDefFoundError&colon; javax&sol;servlet&sol;ServletContext

    Spring boot ---- java.lang.NoClassDefFoundError: javax/servlet/ServletContext   场景描述 项目中用到spring boo ...