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 (三) ...
随机推荐
- oracle导入导出小记
问题:11.2.0.3.0 导入 11.2.0.2.0 都是oracle 11g ,从0.3.0到0.2.0 报错,以为是版本问题,结果不是 采用impdp 导入exp导出的文件会报错 所以改为im ...
- Zone.js 简介 & 抛砖引玉
Zone.js是angular团队参照NodeJS的Domain,Dart的Zone,为angular 2开发的核心组件. 一开始,我对Zone.js是拒绝的.我们知道类似的 Domain 模块,主要 ...
- App 卸载记录
http://blog.csdn.net/jiangwei0910410003/article/details/36427963 总结:没有root权限的情况下,还是使用Intent发送卸载请求,同时 ...
- Cheat (tldr, bropages) - Unix命令用法备忘单
cheat 是一个Unix命令行小工具,用来查询一些常用命令的惯用法(我们都知道,man page阅读起来太累了,常常是跳到最后去看 examples,但并不是所有man pages里面都有examp ...
- hdu1251在词典里统计前缀出现的个数
banana band bee absolute acm ba b band abc #include<iostream> using namespace std; //数据结构 s ...
- Spring3系列2 -- 松耦合的实现
Spring3系列2 -- 松耦合的实现 一. 环境 spring-framework-3.2.4.RELEASE jdk1.7.0_11 Maven3.0.5 eclipse-jee-ju ...
- JIT
http://www.cppblog.com/vczh/category/9583.html
- Python--将内容写入文本文件中
#-*- coding: utf-8 -*- import sys __cfg__version__ = 'debug' # release if __name__ == '__main__': pr ...
- sublime3+wamp配置php,(无需配环境变量)
思来想去,最后还是决定给自己的手游加简单后端验证.好久没搞php了,最近搜了搜资料,发现现在php比几年前方便简单的多,有wampserver和sublime用.想想当年我还用记事本+phnow呢. ...
- oracle 日期获取
,'YYYY-MM-DD')星期一, to_char(NEXT_DAy(to_date(,'YYYY-MM-DD')星期日 from dual; select to_char(sysdate,'yyy ...