我已经使用Subversion很多年了,在使用SourceSafe之后,我爱上了Subversion。结合TortoiseSVN,我真的无法想象它还能有什么更好的。
然而,越来越多的开发人员声称Subversion存在问题,我们应该转向新的分布式版本控制系统,比如Git。
Git如何改进Subversion?
我已经使用Subversion很多年了,在使用SourceSafe之后,我爱上了Subversion。结合TortoiseSVN,我真的无法想象它还能有什么更好的。
然而,越来越多的开发人员声称Subversion存在问题,我们应该转向新的分布式版本控制系统,比如Git。
Git如何改进Subversion?
当前回答
这一切都是关于做某事所需的易用性/步骤。
如果我在我的PC/笔记本电脑上开发一个项目,git会更好,因为它的设置和使用要容易得多。 合并时不需要服务器,也不需要一直输入存储库URL's in。
如果只有两个人,我会说git也更简单,因为你可以互相推拉。
一旦你超越了这一点,我就会选择颠覆,因为在这一点上你需要设置一个“专用”服务器或位置。
使用git可以像使用SVN一样做到这一点,但是git的好处被需要执行额外步骤来与中央服务器同步所抵消。在SVN中,你只需要提交。在git中,你必须先执行git commit,然后再执行git push。额外的步骤很烦人,因为你最后做了太多。
SVN也有更好的GUI工具的好处,但是git生态系统似乎正在迅速追赶,所以从长远来看我并不担心这一点。
其他回答
SubVersion最让我恼火的一点是它把自己的文件夹放在项目的每个目录中,而git只把一个文件夹放在根目录中。这不是什么大事,但这样的小事积少成多。
当然,SubVersion有Tortoise,它(通常)非常好。
我喜欢Git,因为它实际上有助于在中大型团队中开发人员之间的沟通。作为一个分布式版本控制系统,通过它的推送/拉系统,它帮助开发人员创建一个源代码生态系统,这有助于管理在单个项目上工作的大量开发人员。
例如,假设你信任5个开发人员,并且只从他们的存储库中提取代码。每个开发人员都有自己的信任网络,从那里提取代码。因此,开发是基于开发人员之间的信任结构,其中代码责任由开发社区共享。
当然,在这里的其他答案中也提到了其他好处。
我喜欢DVCS的主要原因是:
You can commit broken things. It doesn't matter because other peoples won't see them until you publish. Publish time is different of commit time. Because of this you can commit more often. You can merge complete functionnality. This functionnality will have its own branch. All commits of this branch will be related to this functionnality. You can do it with a CVCS however with DVCS its the default. You can search your history (find when a function changed ) You can undo a pull if someone screw up the main repository, you don't need to fix the errors. Just clear the merge. When you need a source control in any directory do : git init . and you can commit, undoing changes, etc... It's fast (even on Windows )
一个相对较大的项目的主要原因是由点3创建的改进的交流。其他的则是不错的奖金。
David Richards关于Subversion / GIT的WANdisco博客
The emergence of GIT has brought with it a breed of DVCS fundamentalists – the ‘Gitterons’ – that think anything other than GIT is crap. The Gitterons seem to think software engineering happens on their own island and often forget that most organizations don’t employ senior software engineers exclusively. That’s ok but it’s not how the rest of the market thinks, and I am happy to prove it: GIT, at the last look had less than three per cent of the market while Subversion has in the region of five million users and about half of the overall market. The problem we saw was that the Gitterons were firing (cheap) shots at Subversion. Tweets like “Subversion is so [slow/crappy/restrictive/doesn't smell good/looks at me in a funny way] and now I have GIT and [everything works in my life/my wife got pregnant/I got a girlfriend after 30 years of trying/I won six times running on the blackjack table]. You get the picture.
我非常喜欢能够在Git中管理源代码的本地分支,而不会混淆中央存储库的水。在许多情况下,我将从Subversion服务器签出代码并运行本地Git存储库,只是为了能够做到这一点。初始化Git存储库不会因为到处都是烦人的.svn文件夹而污染文件系统,这一点也很棒。
至于Windows工具的支持,TortoiseGit处理基本的很好,但我仍然喜欢命令行,除非我想查看日志。我真的很喜欢Tortoise{Git|SVN}在读取提交日志时的帮助方式。