How to Convert Subversion Repo to Git
用了比较长时间的 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的更多相关文章
- convert svn repo to git
https://john.albin.net/git/convert-subversion-to-git 1. 抓取Log 在linux 上做的,其余是在win上做的. 2. svn co svn:/ ...
- repo 和git的用法
1. 服务器版本下载: repo init -u git@192.168.1.11:i700t_60501010/platform/manifest.git-b froyo_almond -m M76 ...
- repo+manifests+git方式管理安卓代码
repo+manifests+git方式管理安卓代码 1.repo的获取 repo只是google用Python脚本写的调用git的一个脚本,主要是用来下载.管理Android项目的软件仓库.(也就是 ...
- 发布 Rafy 源码到 GitHub
最近项目组开始使用 Git 来作为源码管理.我今天就顺便把 Rafy 的源码也迁移到了 github 上,方便大家使用.这是项目的地址:https://github.com/zgynhqf/raf ...
- Git - Tutorial [Lars Vogel]
From: http://www.vogella.com/tutorials/Git/article.html Git - Tutorial Lars Vogel Version 5.6 Copyri ...
- Git - Tutorial官方【转】
转自:http://www.vogella.com/tutorials/Git/article.html#git_rename_branch Lars Vogel Version 5.8 Copyri ...
- Subversion/Git/ReviewBoard工作流程
根据My (work)Git Workflow进行修改,在 Windows下进行测试,http://mojodna.net/2009/02/24/my-work-git-workflow.html 目 ...
- 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 ...
- gitlab & gerrit & git & repo & jenkins
Omnibus GitLab documentation(中文安装说明) 在自己的服务器上部署 GitLab 社区版->较为全面 GIT & REPO & GERRIT (三) ...
随机推荐
- 好老板VS坏老板
以下是漫画图解: 现在大家应该都能做出正确的判断了吧? 那90后的员工碰上70后的老板又会如何呢? 过去30多年来,基于资源禀赋.行政区划及产业政策等,形成了不同城市发展格局,接下来十年中国经济结构调 ...
- IOS中的多线程之GCD
在ios中,使用多线程有三种方式,分别是:NSThread.NSOperation和NSOperationQueue.GCD,在本节,主要讲解一下CDD的使用. GCD(Grand Central D ...
- phpMyAdmin在Mac OS X上的配置和使用
本文主要记录phpMyAdmin在Mac OS X上的配置和使用,避免朋友们走弯路,浪费不必要的时间. 1. 下载: 2. 在"设置"中打开" web shar ...
- mssql2012以后新增的offset分页,看起来爽死了!!!
有没有办法让那时间显示精确到毫秒级呢!!! 2016年12月01日更新 正式用到项目中的时候才发现大坑,那个排序字段必须形成唯一 ,要不然就分页失败的 ...
- 使用cocos2d-x v3.1开发小游戏(基本框架)
小游戏的组成 欢迎界面 在游戏资源未全部加载完之前就需要载入,避免进入游戏会有一段黑屏时间. 可以用来展示游戏名称或者开发者logo. 开始菜单界面 一般用于显示游戏名称和关卡选择(或者称游戏难度选择 ...
- 4kbps~15kbps语音编码器基础框架ACELP
- Html5 localstorage解决Ajax回退的坑
A页面通过ajax加载数据,并且是滚动加载效果,当滚动几个屏幕之后,进入新的链接页面B,再返回到A的时候,A页面的数据有需要重新加载,从头开始了,体验非常不好. 解决办法:1)hash:2)html5 ...
- DataInputStream类和RandomAccessFile类的使用方法
// DataInputStream类实现了DataInput接口,要想从文件中读入二进制数据, // 你需要将DataInputStream与某个字节源相结合,例如FileInputStream / ...
- floor相关
select floor(@f*0.22) -- 直接可显示结果 create table demo( id ,), id1 int ) select * from demo insert into ...
- 关于php的mysqlnd驱动
1.什么是mysqlnd驱动? PHP手册上的描述: MySQL Native Driver is a replacement for the MySQL Client Library (libmys ...