`
jnn
  • 浏览: 283477 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

How to work on the offline subversion repository

阅读更多

Subversion作为开源社区的使用广泛的版本管理工具获得越来越多人的认可。由于其设计理念的关系,简化branch的很多功能,同时对于Merge的功能支持有限,为了能够支持分布式的开发就需要大家采用频繁少改动量的方式向代码库中提交代码,这样尽量减少代码中的冲突。一旦你的网络环境改变了,例如出差或者是休假,那你就很难在你的代码中进行复杂的操作。

 

这里可以和举一个简单的例子,就是你现在想对你的代码进行refactoring的操作,需要修改一些类名(svn mv classA.java classB.java),但是这时你对classA.java 已经进行了一些修改,这样如果你不能及时将你的修改操作进行提交的话,那你就无法很方便的执行上面的重命名操作。

 

那有没有有一个好的方法能帮我完成一个离线的Subversion代码修改呢?<p>我上个礼拜在出差的过程中就遇到这样的问题,由于当时的环境不允许我连入公司内部网络提交代码,我需要构建一个离线的本地开发环境来记录我对代码的修改,同时在回到公司之后将这些代码修改提交到公司内部的Subversion repository。

 

通过Google 我找到了一个叫做Git的版本管理工具,这个软件提供了一个git-svn 子命令,这样你就可以轻松实现一个基于你的Subversion代码库基础上新独立的Git代码库,当然这样你自己在本地的修改可以被Git管理起来,通过 git-svn 完成Subversion代码库 到 本地代码库的同步,以及本地代码库到Subversion代码库的同步工作。

具体步骤如下

1. 使用 git-svn clone <your svn url> projectname

2. 这时你可以放心出差或者是度假了,如果有必要你可以在 projectname 目录下进行你的工作

3. 使用git commit -a -m "I am commiting the code offline " 提交你的代码

4. 当你的出差或者是度假回来

5. 你可以使用 git-svn rebase 来获取自从你离线之后SVN的所有改变信息,当然如果发生冲突了,那还是需要你手工解决这些冲突。

6. 然后你可以使用 git-svn dcommit将你的工作内容提交Subversion的代码库中,当然没有人知道你在用Git来管理你本地的代码;)

 

是不是有点动心了,我们现在开始准备安装Git。

如果你是Linux用户,大家可以用apt 或者 yum 来获取Git 的安装包。

对于Windows用户,目前我知道的方法就是通过CygWin安装git包。

如果你是Vista用户,你会遇到一些额外的问题,好在这些问题都有相关的解决方法,你可以参考Capi's Coroner 的 Blog

 

0
0
分享到:
评论
2 楼 jnn 2008-04-09  
本人觉得git的branch和merg功能比svn强大很多,在权限管理上面是有些问题,但是如果是team开发,开发者基本上都是拥有读写权限的。
git提供了branch的功能,不同的开发者可以在自己的branch工作,使用Git + SVN也是一个team开发问题的解决方案。

1 楼 老熊 2008-04-02  
好像git没有权限控制功能?这在team似乎是个问题。

相关推荐

    Git Version Control Cookbook 无水印pdf 0分

    Finally, you will discover how you can work offline with Git, how to track what is going on behind the scenes, and how to use the stash for different purposes. What you will learn Understand the ...

    Git.Version.Control.Cookbook.1782168451

    Finally, you will discover how you can work offline with Git, how to track what is going on behind the scenes, and how to use the stash for different purposes. What you will learn from this book ...

    From Online Behaviors to Offline Retailing

    Original Paper of 《From Online Behaviors to Offline Retailing》 P. Luo, S. Yan, Z. Liu, Z. Shen, S. Yang and Q. He. From online behaviors to offline retailing. In KDD, 2016. ...

    How to use postman

    介绍前端调试工具Postman

    Image Retrieval via Decoupling Diffusion into Online and Offline Processing

    Efficient Image Retrieval via Decoupling Diffusion into Online and Offline Processing Efficient Image Retrieval via Decoupling Diffusion into Online and Offline Processing Efficient Image Retrieval ...

    Git.Mastering.Version.Control.pdf

    including different options to rewrite the history of a Git repository before you discover how you can work offline with Git, how to track what is going on behind the scenes, and how to use the stash...

    Git Version Control Cookbook 2nd Edition

    Git Version Control Cookbook builds on the success of the previous edition and provides you with an up-to-date guide to solving problems related to versioning. You’ll start by learning about the ...

    How to be a Programmer

    Available on gitbook to read online or download for offline reading (as PDF, ePub or Mobi) Available to buy as a hardcover book (cost covers production & shipping only) - Edition 1, published 04/01/...

    How to use Clonezilla Live with XenServer v1.0 (Offline)

    How to use Clonezilla Live with XenServer v1.0 (Offline),XenServer 实现P2V

    Java_how2j_offline.rar

    本站提供的主要课程,总共 7 个阶段,69个模块,共 1476 个知识页面!包含:Java基础、Java中级、Java高级、Java应用、Java框架、Java工具及中间件、分布式和集群、数据库、第三方开发、实践项目、面试题!

    HTML5 and CSS3

    how to use the canvas to draw shapes. You’ll also get to see how to use CSS3’s shadows, gradients, and transformations, as well as how to learn how to work with fonts. In the last section, we’ll ...

    how2j_offline_2020.01.31.zip

    how2j的离线资源,很好的快速入门javaweb开发的资源. 包含从java基础,到javaweb开发,以及各种框架(spring,hibernate)和工具(git,eclipse)等的介绍

    Building Blockchain Projects -Packt Publishing((2017).pdf )

    IPFS, use the strings library to work with strings, and more. Chapter 8, Building Enterprise Level Smart Contracts, explains how to use Truffle, which makes it easy to build enterprise-level DApps. We...

    Unity Offline Render

    It allows you to capture the game view to a multi-channel OpenEXR or multiple PNG files, supporting not just the final output image, but also some common elements, like depth, per-light shadows, ...

    how2j_offline_2020.01.31.rar

    网页版,也可下载离线版,使用零基础,实践能力强。... 本站提供的主要课程,总共 7 个阶段,69个模块,共 1476 个知识页面。 学习路线有两种 ,一种是循序渐进,一种是由终至始 循序渐进: 点亮了某个模块后,那么其他...

    Comparing consumer complaint responses to online and offline environment

    比较线上抱怨和线下抱怨的影响因素,并对其进行分析,利用了TPB理论。

    The Future of Retail

    Offline-to-Online (O2O) advocates is that, as more offline retailers are closing, brick-and-mortar stores, the transaction volumes for online stores will only continue to grow. For brick-and-mortar ...

    Dropbox 3.14.7 Offline Installer / DROPBOX 离线安装文件

    Work on slides together Edit a presentation with teammates without emailing files back and forth. When you edit a file in a shared folder, everyone gets the update automatically. Never lose a file ...

    HTML5 and JavaScript Web Apps

    This hands-on book shows you how to work with HTML5, JavaScript MVC frameworks, and the latest W3C specifications to build mobile and desktop web apps that are widely supported across all browsers and...

    Microsoft Windows 7 In Depth.pdf

    with your computer to know what it’s capable of, but might not know the details of how to make it all happen. So we show you, in a helpful, friendly, professional tone. In the process, we also hope ...

Global site tag (gtag.js) - Google Analytics