代码版本管理软件评比

article/2025/8/5 15:42:49

 

转载的,回头在翻译一下

If you spend time talking to software developers about tools, one of the biggest topics I hear about are version control tools. Once you've got to the point of using version control tools, and any competent developers does, then they become a big part of your life. Version tools are not just important for maintaining a history of a project, they are also the foundation for a team to collaborate. So it's no surprise that I hear frequent complaints about poor version control tools. In our recent ThoughtWorks technology radar, we called out two items as version control tools that enterprises should be assessing for use: Subversion and Distributed Version Control Systems (DVCS). Here I want to expand on that, summarizing many discussions we've had internally about version control tools.

代码版本管理软件

But first some pinches of salt. I wrote this piece based on an unscientific agglomeration of conversations with my colleagues inside ThoughtWorks and various friends and associates outside. I haven't engaged in any rigorous testing or structured comparisons, so like most of my writing this is based on AnecdotalEvidence. My personal experience in recent years is mostly subversion and mercurial, but my usage patterns are not typical of a software development team. Overwhelmingly my contacts like to work in an agile-xp approach (even if many sniff at the label) and need tools that support that work style. I expect many people to be annoyed by this article. I hope that annoyance will lead to good articles that I can link to.

(After writing this I did do a small VcsSurvey which didn't undermine my conclusions.)

Fundamentally there's three version control systems that get broad approval: subversion (svn), git, and mercurial(hg).

Behind the Recommendability Threshold

Many tools fail to pass the recommendability threshold. There are two reasons why: poor capability or poor visibility.

Many tools garner consistent complaints from ThoughtWorkers about their lack of capability. (ThoughtWorkers being what they are, all tools, including the preferred set, get some complaints. Those behind the threshold get mostlycomplaints.) Two in particular generate a lot of criticism: ClearCase (from IBM) and TFS (from Microsoft). One reason they get a lot of criticism is that they are very popular on client sites, often with company policies mandating their use (I'll describe a coping strategy for that at the end).

It's fair to say that often these problems are compounded by company policies around using VCS. I've heard of some truly bizarre work-flows imposed on teams that make it a constant hurdle to get anything done. Since the VCS is the tool that enforces these work-flows, it does tend to get tarred with that brush.

I'm not going to go into details about the problems the poor-capability tools have here, that would be another article. (This has probably made me even more unpopular in IBM and Microsoft as it is.) I will, at least for the moment, leave it with the fact that developers I respect have worked extensively with, and do not recommend, these products.

The second reason for shuffling a tool behind the recommendability threshold is that I don't hear many comments about some tools. This is an issue because less-popular tools make it difficult to find developers who know how to use them or want to find out. There are many reasons why otherwise good tools can fall behind there. I used to hear people say good things about Perforce, but now the feeling seems to be that it doesn't have compelling advantages over Subversion, let alone the DVCSs. Speaking of DVCSs, there are more than just the two I've highlighted here. Bazaar, in particular, is one I occasionally hear good things about, but again I hear about it much less often then git or Mercurial.

Before I finish with those behind the threshold, I just want to say a few things about a particularly awful tool: Visual Source Safe, or as I call it: Visual Source Shredder. We see this less often now, thank goodness, but if you are using it we'd strongly suggest you get off it. Now. Not just is it a pain to use, I've heard too many tales of repository corruption to trust it with anything more valuable than foo.txt.

So this leaves three tools that my contacts are generally happy with. I find it interesting that all three are open-source. Choosing between these tools involves first deciding between a centralized or distributed VCS model and then, if you chose DVCS, choosing between git and mercurial.

Distributed or Centralized

Most of the time, the choice between centralized and distributed rests on how skilled and disciplined the development team is. A distributed system opens up lots of flexibility in work-flow, but that flexibility can be dangerous if you don't have the maturity to use it well. Subversion encourages a simple central repository model, discouraging large scale branching. In an environment that's using Continuous Integration, which is how most of my friends like to work, that model fits reasonably well. As a result Subversion is a good choice for most environments.

And although DVCSs give you lots of flexibility in how you arrange your work-flows, most people I know still base their work patterns on the notion of a shared mainline repository that's used with Continuous Integration. Although modern VCS have almost magic tools to merge different people's changes, these merges are still just merging text. Continuous Integration is still necessary to get semantic consistency. So as a result even a team using DVCS usually still has the notion of the central master repository.

Subversion has three main downsides compared to its cooler distributed cousins.

Because distributed systems always give you a local disk copy of the whole repository, this means that repository operations are always fast as they don't involve network calls to central servers. This is a palpable difference if you are looking at logs, diffing to old revisions, and anything else that involves the full repository. If this is noticeable on my home network, it is a huge issue if your repository is on another continent - as we find with our distributed projects.

If you travel away from your network connection to the repository, a distributed system will still allow you to work with the repository. You can commit checkpoints of your work, browse history, and compare revisions on an airplane without a network connection.

The last downside is more of a social issue than a true tool issue. DVCS encourages quick branching for experimentation. You can do branches in Subversion, but the fact that they are visible to all discourages people from opening up a branch for experimental work. Similarly a DVCS encourages check-pointing of work: committing incomplete changes, that may not even compile or pass tests, to your local repository. Again you could do this on a developer branch in Subversion, but the fact that such branches are in the shared space makes people less likely to do so.

This last point also leads to the argument against a DVCS, that it encourages wanton branching, that feels good early on but can easily lead you to merge doom. In particular the FeatureBranch approach is a popular one that I don't encourage. As with similar comments earlier I must point out that reckless branching isn't something that's particular to one tool. I've often heard people in ClearCase environments complain of the same issue. But DVCSs encourage branching, and that's the major reason why I indicate that team needs more skill to use a DVCS well.

There is one particular case where subversion is the better choice even for a team that skilled at using a DVCS. This case is where the artifacts you're collaborating on are binary and cannot be merged by the VCS - for example word documents or presentation decks. In this case you need to revert to pessimistic locking with single-writer checkouts - and that requires a centralized system.

Git or Mercurial

So if you're going to go the DVCS route - which one should you choose? Mercurial and git get most of the attention, so I feel the choice is between them. Then the choice boils down to power versus usability, with a dash of mind-share and the shadow of github.

Git certainly seems to be liked for its power. Folks go ga-ga over it's near-magical ability to do textual merges automatically and correctly, even in the face of file renames. I haven't seen any objective tests comparing merge capabilities, but the subjective opinion favors git.

(Merge-through-rename, as my colleague Lucas Ward defines it, describes the following scenario. I rename Foo.cs to Bar.cs, Lucas makes some changes to Foo.cs. When we merge his changes are correctly applied to Bar.cs. Both git and Mercurial handle this.)

For many git's biggest downside was its oft-cryptic commands and mental model. Ben Butler-Cole phrased it beautifully: "there is this amazingly powerful thing writhing around in there that will basically do everything I could possibly ask of it if only I knew how." To its detractors, git lacks discoverability - the ability to gradual infer what it does from it's apparent design. Git's advocates say that much of this is because it uses a different mental model to other VCSs, so you have to do more unlearn your knowledge of VCS to appreciate git. Whatever the reason git seems to be attractive more to those who enjoy learning the internals while mercurial seems to appeal more to those who just want to do version control.

The shadow of github is important here. Even git-skeptics rate it as a superb place for project collaboration. Mercurial's equivalent, bitbucket, just doesn't inspire the same affection. However there are other sites that may begin to close the gap, in particular Google Code and Microsoft's Codeplex. (I find Codeplex's use of Mercurial very encouraging. Microsoft is often, rightly, criticized for not collaborating well with complementary open source products. Their use of Mercurial on their open-source hosting site is a very encouraging sign.)

Historically git worked poorly on Windows, poorly enough that we'd not suggest it. This has now changed, providing you run it using msysgit and not cygwin. Our view now is that msysgit is good enough to make comparison with Mercurial a non-issue for Windows.

People generally find that git handles branching better than Mercurial, particular for short-lived branches for experimentation and check-pointing. Mercurial encourages other mechanisms, such as fast cloning of separate repository directories and queue patching, but git's branching is a simpler and better model.

Mercurial does seem to have an issue with large binary files. My general suggestion is that such things are usually better managed with subversion, but if you have too few of them to warrant separate management, then Mercurial may get hung up by the few that you have.

Multiple VCS

There's often value to using more than one VCS at the same time. This is generally where there is a wider need to use a less capable VCS than your team wants to use.

The case that we run into frequently is where there is a corporate standard for a deficient VCS (usually ClearCase) but we wish to work efficiently. In that case we've had success using a different VCS for day-to-day team team work and committing to the corporate VCS when necessary. So while the team VCS will see several commits per person per day, the corporate VCS sees a commit every week or two. Often that's what the corporate admins prefer in any case. Historically we've done this using svn as the local VCS but in the future we're more likely to use a DVCS for local fronting.

This dual usage scenario is also common with git-svn where people use git locally but commit to a shared svn system. Git-svn is another reason for preferring git over mercurial. Using a local DVCS is particularly valuable for remote site working, where network outages and bandwidth problems can cripple a site that's remote from a centralized VCS.

A lot of teams can benefit from this dual-VCS working style, particularly if there's a lot of corporate ceremony enforced by their corporate VCS. Using dual-VCS can often make both the local development team happier and the corporate controllers happier as their motivations for VCS are often different.

One Final Note

Remember that although I've jabbered on a lot about tools here, often its the practices and workflows that make a bigger difference. Tools can certainly make it much easier to use a good set of practices, but in the end it's up to the people to use an effective way of working for their environment. I like to see approaches that allow many small changes that are rapidly integrated using Continuous Integration. I'd rather use a poor tool with CI than a good tool without.

 


http://chatgpt.dhexx.cn/article/eiIXZ85k.shtml

相关文章

Git(代码版本管理软件、工具 详细)

Git 使用步骤 在创建的文件夹里面 。。。 (不要用中文名字)右键Git Bash Here 小黑框在小黑框里写:git init (意思是初始化一个仓库),//一个项目一次就可以 会出现一个隐藏的.git文件夹,不要动在里面敲代码就可以了 小…

Git版本管理软件使用

Git是目前世界上最先进的分布式版本控制系统,下面介绍如何使用Git管理项目。 一、下载Window Git工具 https://pan.baidu.com/s/1EF_KybTb32VACzXniFBDdw 下载安装 设置Window环境变量path,包括Git的bin目录 启动CMD窗口,输入git,出现如…

cad图纸版本号管理软件-彩虹EDM图纸管理软件

cad图纸版本号管理软件-彩虹EDM图纸管理软件-由南宁市二零二五科技有限公司 自主研发。 通过安装对应软件接口,彩虹EDM能够与CAD/EDA软件集成通讯;可以读取CAD/EDA图纸信息创建装配关系,在这些软件提供在线菜单,在编辑文件的时候…

03-代码版本管理软件推荐

http://www.gitkraken.com/ GitKraken也同时支持其他的代码托管服务,(非GitHub仅有),但是确实并不是所有功能都是完全免费的(大家可以搜索GitCracken,但还是希望大家支持正版); 另外…

版本管理软件--Git的安装、配置并使用

版本管理软件分类 集中式,典型代表 SVN 分布式,典型代表 Git 安装 安装git,一直 下一步 安装即可,如果不想安装到C盘,可以把C换成D不要安装到含有中文的路径中。安装完毕,不可以剪切(移动&a…

R、冗余分析(RDA)、ggplot2、置信椭圆

R、冗余分析(RDA)、ggplot2、置信椭圆 在生态环境领域中(实际中,其他专业也用到),冗余分析(RDA)是我们常用的分析方法,分析目的为“解释变量”对“响应变量”的影响情况。…

R语言线性判别分析(LDA),二次判别分析(QDA)和正则判别分析(RDA)

判别分析包括可用于分类和降维的方法。线性判别分析(LDA)特别受欢迎,因为它既是分类器又是降维技术。二次判别分析(QDA)是LDA的变体,允许数据的非线性分离。最后,正则化判别分析(RDA…

222Beta多样性限制性排序CPCoA/CCA/RDA/LDA

222Beta多样性限制性排序CPCoA/CCA/RDA/LDA 本节作者:文涛,南京农业大学;刘永鑫,中科院遗传发育所 版本1.0.5,更新日期:2020年8月12日 本项目永久地址:https://github.com/YongxinLiu/Microbiom…

R包vegan的冗余分析(RDA)

冗余分析(Redundancy analysis,RDA)是一种回归分析结合主成分分析的排序方法,也是多响应变量(multi-response)回归分析的拓展。在群落分析中常使用RDA,将物种多度的变化分解为与环境变量相关的变差(variation;或称方差,variance,因为RDA中变差=方差;由约束/典范轴承…

RDA_环境因子_群落结构_统计检验_可视化

RDA环境因子群落结构统计检验可视化 环境因子的筛选及数据的转化方面请参阅宏基因组公众号之前的推文,本文主要侧重统计分析与可视化 看到师兄文章里的图自己可能用到,想复现一下,于是就尝试了一下,顺便写个推文记录,在…

使用RDA技术实现数据的自动化分析

有人说,数据是一种新的能源,形成了一种令人垂涎的资源,为企业决策提供动力。虽然,原始形式的数据并没有多大用处。它需要被提取、提炼和加工——其成分通过从源头到炼油厂再到最终消费者,输送到各种产品中。 数据处理的…

在线画图工具-CCA与RDA分析

网站: http://www.qplot.cn:3838/sample-apps/006-CCA_RDA/ RDA分析(Redundancy analysis),即冗余分析,对比主成分分析可以发现,其实冗余分析就是约束化的主成分分析。 RDA或CCA的选择问题:RDA是基于线性模型&#xff…

rda分析怎么做_R语言做冗余分析(RDA)的一个简单小例子

冗余分析(redundancy analysis, RDA)自己之前也听过,好像是生态学研究中用的比较多,主要是用来探索环境和一些样本指标之间的关系。最近自己在看一些群体遗传相关的内容,发现RDA也可以用在群体遗传方面 ,比如这个参考链接 https://popgen.nescent.org/2018-03-27_RDA_GEA.h…

CCA分析图如何解读_微生物群落与环境因子关联:全自动的CCA/RDA分析流程!!...

环境因子关联 在微生物群落研究中,我们通常都希望知道微生物群落变化是会受到哪些因素的影响,在这些因素中,什么因素是主要的影响因素? 回答这一问题需要将微生物群落数据与其对应的环境因子进行关联分析,在这一项分析中,使用最早也是使用频率最高的分析就是CCA/RDA。 CC…

rda分析怎么做_数量生态学笔记||冗余分析(RDA)

上一节数量生态学笔记||冗余分析(RDA)概述中,我们回顾了RDA的计算过程,不管这个过程我们有没有理解透彻,我希望你能知道的是:RDA是响应变量矩阵与解释变量之间多元多重线性回归的拟合值矩阵的PCA分析。本节我们就是具体来看一个RDA的分析案例,来看看里面的参数以及结果的解…

R语言数量生态学冗余分析RDA分析植物多样性物种数据结果可视化

最近我们被客户要求撰写关于冗余分析RDA的研究报告,包括一些图形和统计输出。 冗余分析(redundancy analysis,RDA)是一种回归分析结合主成分分析的排序方法,也是多因变量(multiresponse)回归分…

win10 摄像头启动不了

1.检查摄像头驱动是否安装。通过电脑-》设备管理器查看 2.驱动这些都安好,但是还是不能使用摄像头,可能是由于Win10系统,对于隐私的保护造成的。可以通过设置中的相机隐私设置,打开相关权限

win10相机打不开,显示错误代码0xA00F4246(0x800706D9)

有时我们在不知道什么情况下电脑便会变成这个样子,当我们以为是驱动问题的时候,或许我们可以使用下面的办法解决这个问题 方法: 1.WIN键R打开命令端,输入regedit运行 2.进入 计算机\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Window…

win10如何打开摄像头_解决win10相机无法使用,相机崩溃问题

win10系统可能因很多原因无法使用,例如权限设置,或者win10系统本身问题,此教程教大家如何解决 1、进入电脑系统设置,在里面找到”隐私“,并点击进入 2、进入隐私设置界面后,向下滑动找到”相机“&#xff0…

Win10相机报错解决办法

一:问题描述: Win10相机打开报错:我们找不到你的相机 错误代码0xA00f4244 二、解决办法: 我是用第三个解决相机无法使用的,可以优先试试哟。 办法之一: 官网解决方案: Win10找不到相机&#xf…