简体   繁体   English

使用SVN定义基于功能的开发的工作流程

[英]Defining workflow for feature based development using SVN

I think this problem is general when we work with disconnected version controls like SVN on GIT. 我认为当我们在GIT上使用SVN之类的断开连接的版本控件时,此问题很普遍。 I'm coming from Clearcase background where there's an active server and the files are just virtual copies in our system. 我来自Clearcase背景,那里有一个活动的服务器,文件只是我们系统中的虚拟副本。

If I talk in the clearcase perspective, if more than one people are working for a particular feature, this will be branched out seperately and checked in the particular branch by the developer branch. 如果我是从透明案例的角度讲的话,那么如果有多个人正在为某个特定功能工作,那么它将被单独分支出来,并由developer分支在特定分支中进行检查。 Once the entire feature is done, it will be merged back to the main branch. 完成全部功能后,它将合并回到主分支。 Essentially we're not screwing up the main branch by the halfcooked features. 从本质上讲,我们并不是通过半成品功能来拧紧主分支。 Because the others could hurt with the daily build. 因为其他人可能会损害日常工作。

The above method is good to go as I've a branch out there in the clearcase server. 上面的方法很好,因为我在Clearcase服务器中有一个分支。 With disonnected version controls like SVN and GIT, how to solve this problem? 使用诸如SVN和GIT之类的非版本控制,如何解决此问题? Is it required to setup a separate server and share with the developers to accomplish this? 是否需要设置单独的服务器并与开发人员共享才能完成此任务?

在此处输入图片说明

For Git, you don't have to set a separate feature. 对于Git,您不必设置单独的功能。
You can create as many feature branch as required, and merge them in a non-fast-forward way in order to achieve the same goal. 您可以根据需要创建任意数量的功能分支,并以非快进方式合并它们以实现相同的目标。

See " Why does git use fast-forward merging by default? " for more. 有关更多信息,请参见“ 为什么git默认使用快速转发合并? ”。

SVN can offer the same kind of workflow, except the merge back to the main branch might need a " merge --reintegrate " slightly different than a classic merge (and with a few pending bugs like this one with SVN 1.7). SVN可以提供相同类型的工作流,只是合并回主分支可能需要“ merge --reintegrate ”,这与经典合并略有不同(并且还有一些待解决的错误, 例如 SVN 1.7)。

The difference between the two is regarding the publication of the branches: 两者之间的区别在于分支的发布

  • SVN will declare the branch in its central repo, visible for all SVN将在其中央仓库中声明该分支,所有分支都可见
  • Git users declare their branches in their local repo, can merge back on a main common branch, but choose what they push back to a central repo: only the update common branch with new commits, and/or also their feature branch. Git的用户在其本地回购申报分支机构,可以合并回主公共分支,但选择什么样的,他们推回中央回购:只有更新公共分支新的提交,和/或也是他们的特性分支。

See " this question " for more on the orthogonal aspect introduced by a DVCS (like Git) compared to a centralized VCS like SVN. 有关与集中式VCS(如SVN)相比,DVCS(如Git)引入的正交方面的更多信息,请参见“ 此问题 ”。

You'll want to use the branch concept in Subversion or Git — no need for any separate server. 您将要在Subversion或Git中使用分支概念-不需要任何单独的服务器。 The two systems work radically different: 这两个系统的工作原理截然不同:

  • Subversion: , you make a foo branch by making a copy from /trunk to /branches/foo . 颠覆: ,你犯了一个foo通过复印从分支/trunk/branches/foo Subversion doesn't really have a notion of a "branch", but since you can merge between folders you can emulate branches that way. Subversion实际上没有“分支”的概念,但是由于可以在文件夹之间合并,因此可以模拟分支。 This is covered in the SVN book . 这在SVN书中有介绍

  • Git: you create a real branch with git branch foo . Git:使用git branch foo创建一个真实的分支。 Branches are first-class citizens in Git and an integral part of how you use the system. 分支机构是Git中的一等公民,也是您使用系统的组成部分。 Any good Git tutorial will cover branches, please see my link to the Git book. 任何好的Git教程都将涵盖分支,请参阅我的Git书链接

Followup to Von and Martin 冯和马丁的跟进

  • SVN isn't really fully "disconnected" VCS (as Git or any other DVCS are ), because, at commit-update stage developer's Working Copy (snapshot of some tree from central repo at some moment) communicate with central server and local changes can not be stored in gepo before getting in merging "other changes" (if they appeared before commit attempt) SVN并不是完全“断开连接”的VCS(就像Git或任何其他DVCS 一样 ),因为在提交更新阶段,开发人员的工作副本(有时来自中央仓库的某些树的快照)与中央服务器进行通信,并且本地更改可以在合并“其他更改”之前,不要存储在gepo中(如果它们在提交尝试之前出现)
  • "Branch per feature" with more-than-one developers per branch still possible (in SVN-world), even in two slightly different forms: 即使在两种略有不同的形式下,“每个功能分支”仍然可以在每个分支中有一个以上的开发人员(在SVN世界中):
    1. A direct analogy (and bad workflow ) with CC - each developer can have own personal branch, but during development process they periodically merge other-branches to own (and trunk to branch), all finished branches merged to trunk 与CC的直接类比(和糟糕的工作流程 )-每个开发人员都可以拥有自己的个人分支,但是在开发过程中,他们会定期将其他分支合并到自己的分支(并在分支到分支),所有完成的分支都合并到分支
    2. Single branch for any amount of developers (common widely used way), svn up is a must before any code-changes in order to get new committed changes from others into local Working Copy (without it changes can not be commited to repository, update+merge on top of own changes can broke code) 对于任何数量的开发人员(普遍使用的方式)而言,单个分支都是必须的,在进行任何代码更改之前,必须先进行svn up ,才能将其他新提交的更改从其他更改保存到本地工作副本中(如果不进行更改,则无法提交至存储库,update +合并自身的更改可能会破坏代码)

In both workflows branches are placed on one central repository, bi-directional data exchange between Subversion repositories is big headache for SVN-admins 在两个工作流分支中,一个都放置在一个中央存储库中,Subversion存储库之间的双向数据交换使SVN管理员头疼不已

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM