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

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


当前回答

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。

其他回答

这个链接可以帮助你理解其中的区别 http://www.techtatva.com/2010/09/git-mercurial-and-bazaar-a-comparison/

在InfoQ的DVCS指南中,有一个关于git、Mercurial和Bazaar的非常详尽的比较表和图表。

我认为关于“Mercurial vs. Git”最好的描述是:

“Git是韦斯利·斯奈普斯。Mercurial是丹泽尔·华盛顿

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

没什么。他们都做同样的事,都表现得差不多。你应该选择其中一个而不是另一个的唯一原因是,如果你帮助一个已经使用其中一个的项目。

选择一个系统的另一个可能的原因是应用程序或服务只支持其中一个系统。例如,我选择学习git是因为github..