我已经在Windows上使用git有一段时间了(使用msysGit),我喜欢分布式源代码控制的想法。就在最近,我一直在关注Mercurial (hg),它看起来很有趣。然而,我无法理解hg和git之间的区别。

有人把git和hg放在一起比较吗?我很想知道hg和git有什么不同,而不需要加入粉丝的讨论。


当前回答

我意识到这不是答案的一部分,但在这一点上,我也认为像NetBeans和Eclipse这样的平台的稳定插件的可用性在某种程度上决定了哪种工具更适合这项任务,或者更确切地说,哪种工具最适合“你”。也就是说,除非你真的想用cli方法。

Eclipse(以及基于它的一切)和NetBeans有时在远程文件系统(如SSH)和文件的外部更新方面都有问题;这也是为什么你希望你选择的任何东西都能“无缝”工作的另一个原因。

我现在也在为自己回答这个问题。我已经把候选人归结为Git或Mercurial ..感谢大家在没有宗教色彩的情况下就这个话题提供有用的意见。

其他回答

在versioncontrolblog上有一个动态比较图表,你可以比较几种不同的版本控制系统。

这是git, hg和bzr之间的对比表。

Git是一个平台,Mercurial“只是”一个应用程序。Git是一个版本控制的文件系统平台,附带了一个DVCS应用程序,但与平台应用程序一样,它比集中的应用程序更复杂,也更粗糙。但这也意味着git的VCS非常灵活,你可以用git做大量非源代码控制的事情。

这就是区别的本质。

Git is best understood from the ground up – from the repository format up. Scott Chacon’s Git Talk is an excellent primer for this. If you try to use git without knowing what’s happening under the hood, you’ll end up confused at some point (unless you stick to only very basic functionality). This may sound stupid when all you want is a DVCS for your daily programming routine, but the genius of git is that the repository format is actually very simple and you can understand git’s entire operation quite easily.

对于一些更偏向技术的比较,我个人看过的最好的文章是Dustin Sallings的:

Mercurial和Git的区别 Reddit上有经验丰富的达斯汀回答他自己的新手问题的帖子

实际上,他已经广泛地使用了这两种DVCSs,并且对它们都很了解——最后他更喜欢git。

I'm currently in the process of migrating from SVN to a DVCS (while blogging about my findings, my first real blogging effort...), and I've done a bit of research (=googling). As far as I can see you can do most of the things with both packages. It seems like git has a few more or better implemented advanced features, I do feel that the integration with windows is a bit better for mercurial, with TortoiseHg. I know there's Git Cheetah as well (I tried both), but the mercurial solution just feels more robust.

因为它们都是开源的(对吧?)我认为这两款游戏都不会缺少重要的功能。如果某样东西很重要,人们就会提出要求,就会编写代码。

我认为对于常见的实践,Git和Mercurial已经足够了。它们都有使用它们的大型项目(Git -> linux内核,Mercurial -> Mozilla基金会项目,当然都在其他项目中),所以我不认为它们真的缺少什么。

也就是说,我对其他人对此的看法很感兴趣,因为这将为我的博客努力提供一个很好的来源;-)

mercurial和git的另一个有趣的比较:mercurial vs git。 主要关注内部结构及其对分支过程的影响。

在你的项目中有基于windows的合作者吗?

因为如果有的话,Git-for-Windows GUI就显得笨拙、困难、不友好了。

相比之下,“windows上的水银”则是显而易见的。