Migrating from SVN to Git

首先我们需要在Stach或者GitHub上新建一个Repository, 拿到它的URL。 接下来参照如下步骤 :

At first we should create a new git repository at Stash and get the repository URL, and then follow below steps:

1. 切换到本地git工作目录

change to the git working directory :

$cd c:/git

2. 将svn目录格式转换为git形式, 可选为标准格式或Trunk格式

--import the contents (svn repository) into the new Git repository:

this command transform the trunk, branches, and tags in SVN repostory into a new repository.

Depending on different structure of SVN layout, we need different parameter for this command.

[1] $git svn clone [svn repository url] -s

-s : standard layout, there should be trunk,branches, and tags for SVN repository.

[2] $git svn clone [svn repository url] -t Trunk

-t Trunk :  only for trunk

3. 连接同步本地库和远程库

$git remote add origin [git repository url]

this command is used to add a remote which is just a shotcut for the git repository url.

Now we use the command to add a remote "origin" for our new git repository

4. 推送本地代码到远程分支

$git push origin --all

this command push all the local repository to bitbucket repository.

If you just need to push specific branch, such as "master" , use this command :

$git push origin master

After these , Bitbucket repository is now a clone of local repository, we can check the history at the Stash.

Git迁移 从SVN到Git的更多相关文章

  1. 代码托管SVN到Git迁移(使用小乌龟工具)

    1.环境信息 Git   Server     华为软件开发云   代码托管 SVN Server    本地SVN服务器   Windows Server2012 R2 本地主机       Win ...

  2. git学习------>从SVN迁移到Git之后,项目开发代码继续在SVN提交,如何同步迁移之后继续在SVN提交的代码到Git?

    最近逐步逐步的将公司的项目都从SVN往Git迁移了,但是想团队成员都能够一步到位就迁移到Git是不可能的,因为还有大部分人都还不会Git,所以整个过渡过程估计得大半年. 因此导致虽然项目迁移过来了,但 ...

  3. 从SVN到Git最强指南

    对于软件开发人员来说,版本控制系统他们再熟悉不过了,所谓版本控制系统就是软件项目开发过程中用于储存开发人员所写代码所有修订版本的软件.它的主要目的是实现开发团队并行开发.提高开发效率,对软件开发进程中 ...

  4. SVN与Git

    一:SVN是什么?SVN是Subversion的简称,是一个开放源代码的版本控制系统,相较于RCS.CVS,它采用了分支管理系统,它的设计目标就是取代CVS.互联网上很多版本控制服务已从CVS迁移到S ...

  5. 【转】为什么要用GIT而不是SVN

    原文网址:http://www.cnblogs.com/perseus/archive/2012/11/22/2782051.html 使用了近一年的git之后,再使用svn,发现自己svn这种版本管 ...

  6. 命令行操作svn和git和git

    前几天在写代码的时候电脑突然坏掉,老大交代的任务没完成,非常痛恨自己用svn或者git保存代码,相信很多程序员遇到过,硬盘坏掉,存在硬盘中的代码丢失,无法找回的问题,svn和git可谓程序员界的福音, ...

  7. git-svn:通过git来管理svn代码

    简介 svn和git都是常用的版本管理软件,但是git无论在理念或是功能上都比svn更为先进.但是有的公司是以svn作为中央仓库,这时git与svn代码的同步就可以通过 git-svn这个软件进行,从 ...

  8. Svn与Git的一些区别(转载)

    把第一条理解到位思想到位了做起来才会有的放矢,其他几条都是用的时候才能体会到 1) 最核心的区别Git是分布式的,而Svn不是分布的.能理解这点,上手会很容易,声明一点Git并不是目前唯一的分布式版本 ...

  9. SVN和git的使用(附github的简单玩法)

    今天简单的总结了下SVN和git的使用,也尝试了下github,应该好好提高下自己的英文水平了,梦想有一天不再使用任何翻译软件. [svn]:集中式的代码管理工具(版本控制工具--版本记录) 1> ...

随机推荐

  1. jQuery弹出层layer插件的使用

    引入插件layer 触发弹出层的按钮/链接 <a href="javascript:showPop();"> <img src="" /> ...

  2. 170221、浅谈mysql的SQL的四种连接

    例子:   -------------------------------------------------  a表     id   name     b表     id   job   pare ...

  3. Java日志记录工具SLF4J介绍

    SLF4J是什么 SLF4J是一个包装类,典型的facade模式的工具,对用户呈现统一的操作方式,兼容各种主流的日志记录框架,典型的有log4j/jdk logging/nop/simple/jaka ...

  4. Appium自动化环境搭建(windows+Android)

    开始安装: 1.首先搭建好Android开发环境(eclipse+jdk+android的sdk包+Level17或以上的版本api) 2.设置ANDROID_HOME系统变量为你的Android S ...

  5. SVG Use(转)

    转自:http://www.zhangxinxu.com/wordpress/2014/07/introduce-svg-sprite-technology/ 未来必热:SVG Sprite技术介绍 ...

  6. Nordic Blue Tooth

    一 . nordic BLE4.0 1.开发nordic的应用需要安装支持keil的pack库和插件 2.nordic的SDK很完整,实例涵盖了几乎所有的应用 https://www.nordicse ...

  7. jvm堆配置参数

    1.-Xms初始堆大小默认物理内存的1/64(<1GB)(官方建议)2.-Xmx最大堆大小默认物理内存的1/4(<1GB)(官方建议),实际中建议不大于4GB3.一般建议设置 -Xms=- ...

  8. 正则表达式 - JavaScript描述

    正则表达式 - JavaScript描述 概述 正则表达式是被用来匹配字符串中的字符组合的模式.在JavaScript中,正则表达式也是对象. 创建正则表达式 var re = /abc/; // 使 ...

  9. jdk1.7 ArrayList源码浅析

    参考:http://www.cnblogs.com/xrq730/p/4989451.html(借鉴的有点多,哈哈) 首先介绍ArrayList的特性: 1.允许元素为空.允许重复元素 2.有序,即插 ...

  10. (转)HttpWebRequest以UTF-8编码写入内容时发生“Bytes to be written to the stream exceed the Content-Length bytes size specified.”错误

    from:http://www.cnblogs.com/Gildor/archive/2010/12/13/1904060.html HttpWebRequest以UTF-8编码写入内容时发生“Byt ...