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 (三) ...
随机推荐
- 记录一下,如何配置nodejs nginx的反向代理
本文是在mac下配置nodejs 在nginx下的反向代理 1.安装nodejs,之前就安装了. 2.安装nginx ,我采用的直接源码安装 3.进入 /usr/local/nginx/conf 目录 ...
- nginx 反向代理 与 Apache backend的配置联合配置
nginx 反向代理 与 Apache backend的配置联合配置: 说明: nginx 将http映射到Apache上的特定子目录. 配置方法步骤: 1. 设置域名, 子域名映射到指定服务器ip ...
- 使用 Python SimpleHTTPServer 快速共享文件
近期,想着从一个服务器 向另一个服务器传输文件,但是对其知之甚少,就从别人那里知道一种方法,使用 Python SimpleHTTPServer 快速共享文件. 直接运行:python -m Simp ...
- 【转】drupal7请求异常,执行时间过长的解决方法
drupal7请求错误,执行时间过长的解决办法 根据你的系统或网络设置Drupal不能读取网页,造成功能缺失.可能是web服务器配置或PHP设置引起的,可用更新.获取更新源.使用OpenID登 录或使 ...
- 【css】a:hover 设置上下边框在 ie6 和 ie7 下失效
前段时间在写样式的时候发现了这个问题,虽然当时就解决了这个 bug 不过还是记录下,以免再次出现这样的问题. demo 代码: <!doctype html> <html lang= ...
- Homebrew
Homebrew官网:http://brew.sh Homebrew installs the stuff you need that Apple didn't Homebrew的安装非常简单,打开终 ...
- C#后台弹出对话框
Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='jav ...
- Hadoop - Zeppelin 使用心得
1.概述 在编写 Flink,Spark,Hive 等相关作业时,要是能快速的将我们所编写的作业能可视化在我们面前,是件让人兴奋的时,如果能带上趋势功能就更好了.今天,给大家介绍这么一款工具.它就能满 ...
- Hadoop学习笔记(老版本,YARN之前),MapReduce任务Namenode DataNode Jobtracker Tasktracker之间的关系
一.基本概念 在MapReduce中,一个准备提交执行的应用程序称为“作业(job)”,而从一个作业划分出的运行于各个计算节点的工作单元称为“任务(task)”.此外,Hadoop提供的分布式文件系统 ...
- Ranorex入门指南
Ranorex入门指南 http://automationqa.com/forum.php?mod=viewthread&tid=2766&fromuid=29