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

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


当前回答

git和mercurial之间有一个巨大的区别;表示每次提交的方式。Git将提交表示为快照,而mercurial将它们表示为差异。

这在实践中意味着什么?在git中,很多操作都更快,比如切换到另一个提交,比较提交等等。特别是当这些提交距离很远的时候。

说真的,mercurial的方法没有任何优势。

其他回答

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基金会项目,当然都在其他项目中),所以我不认为它们真的缺少什么。

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

如果从SVN迁移,请使用Mercurial,因为它的语法对SVN用户来说更容易理解。除此之外,任何一种选择都不会错。但是在选择之前一定要检查GIT教程和HGinit。

在bitbucket.org的mercurial和github的git之间需要注意的一件事是,mercurial可以有尽可能多的私人存储库,但github你必须升级到付费帐户。所以,这就是为什么我选择使用mercurial的bitbucket。

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

最大的不同在于Windows系统。Mercurial是本地支持的,Git不支持。你可以通过bitbucket.org获得与github.com非常相似的托管(实际上更好,因为你得到了一个免费的私有存储库)。我曾经使用过一段时间的msysGit,但后来转到Mercurial,我对它非常满意。