<p>I've been using git for some time now on Windows (with msysGit) and I like the idea of distributed source control. Just recently I've been looking at Mercurial (hg) and it looks interesting. However, I can't wrap my head around the differences between hg and git.</p>

<p>Has anyone made a side-by-side comparison between git and hg? I'm interested to know what differs hg and git without having to jump into a fanboy discussion.</p>

[{'answer_id': 35844, 'author': 'Erik van Brakel', 'author_id': 909, 'author_profile': 'https://Stackoverflow.com/users/909', 'pm_score': 2, 'selected': False, 'text': "<p>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,\nI 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.</p>\n\n<p>Seeing how they're both open-source (right?) I don't think either will be lacking important features. If something is important, people will ask for it, people will code it. </p>\n\n<p>I think that for common practices, Git and Mercurial are more than sufficient. They both have big projects that use them (Git -> linux kernel, Mercurial -> Mozilla foundation projects, both among others of course), so I don't think either are really lacking something.</p>\n\n<p>That being said, I am interested in what other people say about this, as it would make a great source for my blogging efforts ;-)</p>\n"}, {'answer_id': 35845, 'author': 'jfs', 'author_id': 718, 'author_profile': 'https://Stackoverflow.com/users/718', 'pm_score': 9, 'selected': True, 'text': '<p>These articles may help:</p>\n\n<ul>\n<li><a href="http://importantshock.wordpress.com/2008/08/07/git-vs-mercurial/" rel="noreferrer">Git vs. Mercurial: Please Relax</a> (Git is MacGyver and Mercurial is James Bond)</li>\n<li><a href="http://www.rockstarprogrammer.org/post/2008/apr/06/differences-between-mercurial-and-git/" rel="noreferrer">The Differences Between Mercurial and Git</a></li>\n</ul>\n\n<p><strong>Edit</strong>: Comparing Git and Mercurial to celebrities seems to be a trend. Here\'s one more:</p>\n\n<ul>\n<li><a href="http://www.ericsink.com/entries/hg_denzel.html" rel="noreferrer">Git is Wesley Snipes, Mercurial is Denzel Washington</a></li>\n</ul>\n'}, {'answer_id': 35854, 'author': 'Greg Hewgill', 'author_id': 893, 'author_profile': 'https://Stackoverflow.com/users/893', 'pm_score': 3, 'selected': False, 'text': "<p>Sometime last year I evaluated both git and hg for my own use, and decided to go with hg. I felt it looked like a cleaner solution, and worked better on more platforms at the time. It was mostly a toss-up, though.</p>\n\n<p>More recently, I started using git because of git-svn and the ability to act as a Subversion client. This won me over and I've now switched completely to git. I think it's got a slightly higher learning curve (especially if you need to poke around the insides), but it really is a great system. I'm going to go read those two comparison articles that John posted now.</p>\n"}, {'answer_id': 35903, 'author': 'dbr', 'author_id': 745, 'author_profile': 'https://Stackoverflow.com/users/745', 'pm_score': 4, 'selected': False, 'text': '<p>Nothing. They both do the same, both perform about equally. The only reason you should choose one over the other is if you help out with a project that already uses one..</p>\n\n<p>The other possible reason for choosing one is an application or service which only supports one of the system.. For example, I pretty much chose to learn git because of <a href="http://github.com" rel="nofollow noreferrer">github</a>..</p>\n'}, {'answer_id': 258305, 'author': 'Spoike', 'author_id': 3713, 'author_profile': 'https://Stackoverflow.com/users/3713', 'pm_score': 2, 'selected': False, 'text': '<p>There is a great and exhaustive comparison tables and charts on git, Mercurial and Bazaar over at <a href="http://www.infoq.com/articles/dvcs-guide" rel="nofollow noreferrer">InfoQ\'s guide about DVCS</a>.</p>\n'}, {'answer_id': 258311, 'author': 'mmiika', 'author_id': 6846, 'author_profile': 'https://Stackoverflow.com/users/6846', 'pm_score': 6, 'selected': False, 'text': '<p>The big difference is on Windows. Mercurial is supported natively, Git isn\'t. You can get very similar hosting to <a href="http://www.github.com" rel="nofollow noreferrer">github.com</a> with <a href="http://bitbucket.org" rel="nofollow noreferrer">bitbucket.org</a> (actually even better as you get a free private repository). I was using msysGit for a while but moved to Mercurial and been very happy with it.</p>\n'}, {'answer_id': 258488, 'author': 'Aristotle Pagaltzis', 'author_id': 9410, 'author_profile': 'https://Stackoverflow.com/users/9410', 'pm_score': 6, 'selected': False, 'text': '<p>Git is a platform, Mercurial is “just” an application. Git is a versioned filesystem platform that happens to ship with a DVCS app in the box, but as normal for platform apps, it is more complex and has rougher edges than focused apps do. But this also means git’s VCS is immensely flexible, and there is a huge depth of non-source-control things you can do with git.</p>\n\n<p>That is the essence of the difference.</p>\n\n<p>Git is best understood from the ground up – from the repository format up. <a href="http://blip.tv/file/4094854" rel="nofollow noreferrer">Scott Chacon’s Git Talk</a> 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 <em>can</em> understand git’s entire operation quite easily.</p>\n\n<p>For some more technicality-oriented comparisons, the best articles I have personally seen are Dustin Sallings’:</p>\n\n<ul>\n<li><a href="http://www.rockstarprogrammer.org/post/2008/apr/06/differences-between-mercurial-and-git/" rel="nofollow noreferrer">The Differences Between Mercurial and Git</a></li>\n<li><a href="http://www.reddit.com/r/programming/comments/64g43/aristotle_pagaltzis_why_i_chose_git/c02t4se" rel="nofollow noreferrer">Reddit thread where git-experienced Dustin answers his own git neophyte questions</a></li>\n</ul>\n\n<p>He has actually used both DVCSs extensively and understands them both well – and ended up preferring git.</p>\n'}, {'answer_id': 343196, 'author': 'Spoike', 'author_id': 3713, 'author_profile': 'https://Stackoverflow.com/users/3713', 'pm_score': 3, 'selected': False, 'text': '<p>There is a dynamic comparison chart over at the versioncontrolblog where you can compare several different version control systems. </p>\n\n<p><a href="http://www.versioncontrolblog.com/comparison/Bazaar/Git/Mercurial/index.html" rel="nofollow noreferrer">Here is a comparison table between git, hg and bzr.</a></p>\n'}, {'answer_id': 825332, 'author': 'Konstantin', 'author_id': 101398, 'author_profile': 'https://Stackoverflow.com/users/101398', 'pm_score': 2, 'selected': False, 'text': '<p>Yet another interesting comparison of mercurial and git: <a href="http://rg03.wordpress.com/2009/04/07/mercurial-vs-git/" rel="nofollow noreferrer">Mercurial vs Git</a>.\nMain focus is on internals and their influence on branching process.</p>\n'}, {'answer_id': 828126, 'author': 'Cyberdrow', 'author_id': 44345, 'author_profile': 'https://Stackoverflow.com/users/44345', 'pm_score': 5, 'selected': False, 'text': '<p>I think the best description about "Mercurial vs. Git" is:</p>\n\n<p><a href="http://www.ericsink.com/entries/hg_denzel.html" rel="nofollow noreferrer">"Git is Wesley Snipes. Mercurial is Denzel Washington"</a></p>\n'}, {'answer_id': 892688, 'author': 'Martin Geisler', 'author_id': 110204, 'author_profile': 'https://Stackoverflow.com/users/110204', 'pm_score': 8, 'selected': False, 'text': '<p>I work on Mercurial, but fundamentally I believe both systems are equivalent. They both work with the same abstractions: a series of snapshots (changesets) which make up the history. Each changeset knows where it came from (the parent changeset) and can have many child changesets. The recent <a href="http://hg-git.github.com/" rel="noreferrer">hg-git</a> extension provides a two-way bridge between Mercurial and Git and sort of shows this point.</p>\n\n<p>Git has a strong focus on mutating this history graph (with all the consequences that entails) whereas Mercurial does not encourage history rewriting, <a href="http://www.selenic.com/mercurial/wiki/EditingHistory" rel="noreferrer">but it\'s easy to do anyway</a> and the consequences of doing so are exactly what you should expect them to be (that is, if I modify a changeset you already have, your client will see it as new if you pull from me). So Mercurial has a <em>bias</em> towards non-destructive commands.</p>\n\n<p>As for light-weight branches, then Mercurial has supported repositories with <em>multiple branches</em> since..., always I think. Git repositories with multiple branches are exactly that: multiple diverged strands of development in a single repository. Git then adds names to these strands and allow you to query these names remotely. The <a href="http://www.selenic.com/mercurial/wiki/BookmarksExtension" rel="noreferrer">Bookmarks</a> extension for Mercurial adds local names, and with Mercurial 1.6, you can move these bookmarks around when you push/pull..</p>\n\n<p>I use Linux, but apparently TortoiseHg is faster and better than the Git equivalent on Windows (due to better usage of the poor Windows filesystem). Both <a href="http://github.com" rel="noreferrer">http://github.com</a> and <a href="http://bitbucket.org" rel="noreferrer">http://bitbucket.org</a> provide online hosting, the service at Bitbucket is great and responsive (I haven\'t tried github).</p>\n\n<p>I chose Mercurial since it feels clean and elegant -- I was put off by the shell/Perl/Ruby scripts I got with Git. Try taking a peek at the <a href="http://repo.or.cz/w/git.git?a=blob;f=git-instaweb.sh;hb=HEAD" rel="noreferrer"><code>git-instaweb.sh</code> file</a> if you want to know what I mean: it is a <strong>shell</strong> script which generates a <strong>Ruby</strong> script, which I think runs a webserver. The shell script generates another shell script to launch the first Ruby script. There is also a bit of <strong>Perl</strong>, for good measure.</p>\n\n<p>I like the <a href="http://importantshock.wordpress.com/2008/08/07/git-vs-mercurial/" rel="noreferrer">blog post</a> that compares Mercurial and Git with James Bond and MacGyver -- Mercurial is somehow more low-key than Git. It seems to me, that people using Mercurial are not so easily impressed. This is reflected in how each system do what Linus described as <a href="http://osdir.com/ml/version-control.git/2005-06/msg00792.html" rel="noreferrer">"the coolest merge EVER!"</a>. In Git you can merge with an unrelated repository by doing:</p>\n\n<pre><code>git fetch &lt;project-to-union-merge&gt;\nGIT_INDEX_FILE=.git/tmp-index git-read-tree FETCH_HEAD\nGIT_INDEX_FILE=.git/tmp-index git-checkout-cache -a -u\ngit-update-cache --add -- (GIT_INDEX_FILE=.git/tmp-index git-ls-files)\ncp .git/FETCH_HEAD .git/MERGE_HEAD\ngit commit\n</code></pre>\n\n<p>Those commands look quite arcane to my eye. In Mercurial we do:</p>\n\n<pre><code>hg pull --force &lt;project-to-union-merge&gt;\nhg merge\nhg commit\n</code></pre>\n\n<p>Notice how the Mercurial commands are plain and not special at all -- the only unusual thing is the <code>--force</code> flag to <code>hg pull</code>, which is needed since Mercurial will abort otherwise when you pull from an unrelated repository. It is differences like this that makes Mercurial seem more elegant to me.</p>\n'}, {'answer_id': 1057150, 'author': 'FelipeC', 'author_id': 10474, 'author_profile': 'https://Stackoverflow.com/users/10474', 'pm_score': 4, 'selected': False, 'text': "<p>There's one <strong>huge</strong> difference between <em>git</em> and <em>mercurial</em>; the way the represent each commit. <em>git</em> represents commits as snapshots, while <em>mercurial</em> represents them as diffs.</p>\n\n<p>What does this means in practice? Well, many operations are faster in git, such as switching to another commit, comparing commits, etc. Specially if these commits are far away.</p>\n\n<p>AFAIK there's no advantage of mercurial's approach.</p>\n"}, {'answer_id': 1315859, 'author': 'Krzysztof Kot', 'author_id': 37203, 'author_profile': 'https://Stackoverflow.com/users/37203', 'pm_score': 3, 'selected': False, 'text': '<p>There are quite significant differences when it comes to working with branches (especially short-term ones).</p>\n\n<p>It is explained in <a href="http://mercurial.selenic.com/wiki/BranchingExplained" rel="nofollow noreferrer">this article (BranchingExplained)</a> which compares Mercurial with Git.</p>\n'}, {'answer_id': 3194911, 'author': 'KalEl', 'author_id': 196462, 'author_profile': 'https://Stackoverflow.com/users/196462', 'pm_score': 4, 'selected': False, 'text': '<p>Also google\'s comparison (though it\'s a bit old, done in 2008)</p>\n\n<p><a href="http://code.google.com/p/support/wiki/DVCSAnalysis" rel="nofollow noreferrer">http://code.google.com/p/support/wiki/DVCSAnalysis</a></p>\n'}, {'answer_id': 3301968, 'author': 'asmaier', 'author_id': 179014, 'author_profile': 'https://Stackoverflow.com/users/179014', 'pm_score': 2, 'selected': False, 'text': '<p>If you are interested in a performance comparison of Mercurial and Git have a look at <a href="http://joshcarter.com/productivity/svn_hg_git_for_home_directory" rel="nofollow noreferrer">this article</a>. The conclusion is:</p>\n\n<blockquote>\n  <p>Git and Mercurial both turn in good numbers but make an interesting trade-off between speed and repository size. Mercurial is fast with both adds and modifications, and keeps repository growth under control at the same time. Git is also fast, but its repository grows very quickly with modified files until you repack — and those repacks can be very slow. But the packed repository is much smaller than Mercurial\'s.</p>\n</blockquote>\n'}, {'answer_id': 3475010, 'author': 'Arialdo Martini', 'author_id': 419317, 'author_profile': 'https://Stackoverflow.com/users/419317', 'pm_score': 4, 'selected': False, 'text': '<p>They are almost identical.\nThe most important difference, from my point of view (I mean, the reason that got me to choose one DVCS over the other) is how the two programs manage branches.</p>\n\n<p>To start a new branch, with Mercurial, you simply clone the repository <strong>to another directory</strong> and start developing. Then, you pull and merge.\nWith git, you have to explicitly give a name to the new  topic branch you want to use, then you start coding <strong>using the same directory</strong>.</p>\n\n<p>In short, each branch in Mercurial needs its own directory; in git you usually work in on single directory.\nSwitching branches in Mercurial means changing directories; in git, it means asking git to change the directory\'s content with git checkout.</p>\n\n<p>I\'m honest: I don\'t know if it\'s possible to do the same with Mercurial, but since I usually work on web projects, using always the same directory with git seems much confortable to me, since I don\'t have to re-configure Apache and restart it and I don\'t mess my filesystem everytime I branch.</p>\n\n<p>Edit: As Deestan noted, Hg has <strong>named branches</strong>, which can be stored in a single repository and allow the developer to switch branches within the same working copy. git branches are not exactly the same as Mercurial named branches, anyway: they are permanent and not throw away branches, like in git. That means that if you use a named branch for experimental tasks even if you decide to never merge it it will be stored in the repository. That\'s the reason why Hg encourages to use clones for experimental, short-running tasks and named branches for long-running tasks, like for release branches.</p>\n\n<p>The reason why a lot of Hg users prefere clones over named branch is much more social or cultural than technical. For example, with last versions of Hg, it\'s even possible to close a named branch and recursively remove metadata from changesets.</p>\n\n<p>On the other side, git invites to use "named branches" which are not permanent and are not stored as metadata on each changeset.</p>\n\n<p>From my personal point of view, then, git\'s model is deeply linked to the concept of named branches and switch between a branch and another withing the same directory; hg can do the same with named branches, but yet it encourages the use of clones, which I personally don\'t like too much.</p>\n'}, {'answer_id': 4028577, 'author': 'joho', 'author_id': 418912, 'author_profile': 'https://Stackoverflow.com/users/418912', 'pm_score': 2, 'selected': False, 'text': '<p>I realize this isn\'t a part of the answer, but on that note, I also think the availability of stable plugins for platforms like NetBeans and Eclipse play a part in which tool is a better fit for the task, or rather, which tool is the best fit for "you". That is, unless you <strong>really</strong> want to do it the CLI-way.</p>\n\n<p>Both Eclipse (and everything based on it) and NetBeans sometimes have issues with remote file systems (such as SSH) and external updates of files; which is yet another reason why you want whatever you choose to work "seamlessly".</p>\n\n<p>I\'m trying to answer this question for myself right now too .. and I\'ve boiled down the candidates to Git or Mercurial .. thank you all for providing useful inputs on this topic without going religious.</p>\n'}, {'answer_id': 4285029, 'author': 'Maurice Flanagan', 'author_id': 38791, 'author_profile': 'https://Stackoverflow.com/users/38791', 'pm_score': 5, 'selected': False, 'text': '<p>If you are a Windows developer looking for basic disconnected revision control, go with Hg. I found Git to be incomprehensible while Hg was simple and well integrated with the Windows shell. I downloaded Hg and followed <a href="http://hginit.com/" rel="nofollow">this tutorial (hginit.com)</a> - ten minutes later I had a local repo and was back to work on my project.</p>\n'}, {'answer_id': 4599568, 'author': 'johnbasil', 'author_id': 489533, 'author_profile': 'https://Stackoverflow.com/users/489533', 'pm_score': 3, 'selected': False, 'text': '<p>Are there any Windows-based collaborators on your project?</p>\n\n<p>Because if there are, the Git-for-Windows GUI seems awkward, difficult, unfriendly.</p>\n\n<p>Mercurial-on-Windows, by contrast, is a no-brainer.</p>\n'}, {'answer_id': 5136432, 'author': 'toy', 'author_id': 635162, 'author_profile': 'https://Stackoverflow.com/users/635162', 'pm_score': 3, 'selected': False, 'text': "<p>One thing to notice between mercurial of bitbucket.org and git of github is, mercurial can have as many private repositories as you want, but github you have to upgrade to a paid account. So, that's why I go for bitbucket which uses mercurial. </p>\n"}, {'answer_id': 6924057, 'author': 'static_rtti', 'author_id': 164171, 'author_profile': 'https://Stackoverflow.com/users/164171', 'pm_score': 2, 'selected': False, 'text': '<p>The mercurial website has a <a href="http://mercurial.selenic.com/wiki/GitConcepts" rel="nofollow">great description of the similarities and differences</a> between the two systems, explaining the differences of vocabulary and underlying concepts. As a long time git user, it really helped my understand the Mercurial mindset.</p>\n'}, {'answer_id': 6988815, 'author': 'johndodo', 'author_id': 593487, 'author_profile': 'https://Stackoverflow.com/users/593487', 'pm_score': 2, 'selected': False, 'text': '<p>If you are migrating from SVN, use Mercurial as its syntax is MUCH more understandable for SVN users. Other than that, you can\'t go wrong with either. But do check <a href="http://www.kernel.org/pub/software/scm/git/docs/gittutorial.html" rel="nofollow">GIT tutorial</a> and <a href="http://hginit.com/" rel="nofollow">HGinit</a> before selecting one of them.</p>\n'}, {'answer_id': 8268798, 'author': 'gman', 'author_id': 128511, 'author_profile': 'https://Stackoverflow.com/users/128511', 'pm_score': 4, 'selected': False, 'text': '<p>If I understand them correctly (and I\'m far from an expert on each) they fundamentally each have a different philosophy. I first used mercurial for 9 months. Now I\'ve used git for 6.</p>\n\n<p>hg is version control software. It\'s main goal is to track versions of a piece of software.</p>\n\n<p>git is a time based file system. It\'s goal is to add another dimension to a file system. Most have files and folders, git adds time. That it happens to work awesome as a VCS is a byproduct of its design.</p>\n\n<p>In hg, there\'s a history of the entire project it\'s always trying to maintain. By default I believe hg wants all changes to all objects by all users when pushing and pulling.</p>\n\n<p>In git there\'s just a pool of objects and these tracking files (branches/heads) that determine which set of those objects represent the tree of files in a particular state. When pushing or pulling git only sends the objects needed for the the particular branches you are pushing or pulling, which is a small subset of all objects.</p>\n\n<p>As far as git is concerned there is no "1 project". You could have 50 projects all in the same repo and git wouldn\'t care. Each one could be managed separately in the same repo and live fine.</p>\n\n<p>Hg\'s concept of branches is branches off the main project or branches off branches etc. Git has no such concept. A branch in git is just a state of the tree, everything is a branch in git. Which branch is official, current, or newest has no meaning in git.</p>\n\n<p>I don\'t know if that made any sense. If I could draw pictures hg might look like this where each commit is a <code>o</code></p>\n\n<pre><code>             o---o---o\n            /        \no---o---o---o---o---o---o---o\n         \\         /\n          o---o---o\n</code></pre>\n\n<p>A tree with a single root and branches coming off of it. While git can do that and often people use it that way that\'s not enforced. A git picture, if there is such a thing, could easily look like this</p>\n\n<pre><code>o---o---o---o---o\n\no---o---o---o\n         \\\n          o---o\n\no---o---o---o\n</code></pre>\n\n<p>In fact in some ways it doesn\'t even make sense to show branches in git. </p>\n\n<p>One thing that is very confusing for the discussion, git and mercurial both have something called a "branch" but they are not remotely the same things. A branch in mercurial comes about when there are conflicts between different repos. A branch in git is apparently similar to a clone in hg. But a clone, while it might give similar behavior is most definitely not the same. Consider me trying these in git vs hg using the chromium repo which is rather large.</p>\n\n<pre><code>$ time git checkout -b some-new-branch\nSwitched to new branch \'some-new-branch\'\n\nreal   0m1.759s\nuser   0m1.596s\nsys    0m0.144s\n</code></pre>\n\n<p>And now in hg using clone</p>\n\n<pre><code>$ time hg clone project/ some-clone/\n\nupdating to branch default\n29387 files updated, 0 files merged, 0 files removed, 0 files unresolved.\nreal   0m58.196s\nuser   0m19.901s\nsys    0m8.957\n</code></pre>\n\n<p>Both of those are hot runs. Ie, I ran them twice and this is the second run. hg clone is the actually the same as git-new-workdir. Both of those make an entirely new working dir almost as though you had typed <code>cp -r project project-clone</code>. That\'s not the same as making a new branch in git. It\'s far more heavy weight. If there is true equivalent of git\'s branching in hg I don\'t know what it is. </p>\n\n<p>I understand at some level hg and git <em>might</em> be able to do similar things. If so then there is a still a huge difference in the workflow they lead you to. In git, the typical workflow is to create a branch for every feature. </p>\n\n<pre><code>git checkout master\ngit checkout -b add-2nd-joypad-support\ngit checkout master\ngit checkout -b fix-game-save-bug\ngit checkout master\ngit checkout -b add-a-star-support\n</code></pre>\n\n<p>That just created 3 branches, each based off a branch called master.\n(I\'m sure there\'s some way in git to make those 1 line each instead of 2)</p>\n\n<p>Now to work on one I just do</p>\n\n<pre><code>git checkout fix-game-save-bug\n</code></pre>\n\n<p>and start working. Commit things, etc. Switching between branches even in a project as big as chrome is nearly instantaneous. I actually don\'t know how to do that in hg. It\'s not part of any tutorials I\'ve read.</p>\n\n<p>One other big difference. Git\'s stage. </p>\n\n<p>Git has this idea of a stage. You can think of it as a hidden folder. When you commit you only commit what\'s on the stage, not the changes in your working tree. That might sound strange. If you want to commit all the changes in your working tree you\'d do <code>git commit -a</code> which adds all the modified files to the stage and then commits them.</p>\n\n<p>What\'s the point of the stage then? You can easily separate your commits. Imagine you edited joypad.cpp and gamesave.cpp and you want to commit them separately</p>\n\n<pre><code>git add joypad.cpp  // copies to stage\ngit commit -m "added 2nd joypad support"\ngit add gamesave.cpp  // copies to stage\ngit commit -m "fixed game save bug"\n</code></pre>\n\n<p>Git even has commands to decide which particular lines in the same file you want to copy to the stage so you can split up those commits separately as well. Why would you want to do that? Because as separate commits others can pull only the ones they want or if there was an issue they can revert just the commit that had the issue.</p>\n'}, {'answer_id': 9673491, 'author': 'NewUser', 'author_id': 614208, 'author_profile': 'https://Stackoverflow.com/users/614208', 'pm_score': 1, 'selected': False, 'text': '<p>This link may help you to understand the difference\n<a href="http://www.techtatva.com/2010/09/git-mercurial-and-bazaar-a-comparison/" rel="nofollow">http://www.techtatva.com/2010/09/git-mercurial-and-bazaar-a-comparison/</a></p>\n'}, {'answer_id': 11186287, 'author': 'Kostas', 'author_id': 129363, 'author_profile': 'https://Stackoverflow.com/users/129363', 'pm_score': 1, 'selected': False, 'text': '<p>Some people think that VCS systems have to be complicated. They encourage inventing terms and concepts on the field. They would probably think that numerous PhDs on the subject would be interesting. Among those are probably the ones that designed Git.</p>\n\n<p>Mercurial is designed with a different mentality. Developers should not care much about VCS, and they should instead spend their time on their main function: software engineering. Mercurial allows users to use and happily abuse the system without letting them make any non-recoverable mistakes. </p>\n\n<p>Any professional tool must come with a clearly designed and intuitive CLI. Mercurial users can do most of the work by issuing simple commands without any strange options. In Git double dash, crazy options are the norm. Mercurial has a substantial advantage if you are a CLI person (and to be honest, any self-respecting Software Engineer should be).</p>\n\n<p>To give an example, suppose you do a commit by mistake. You forgot to edit some files. To undo you action in Mercurial you simply type:</p>\n\n<p><code> $ hg rollback </code></p>\n\n<p>You then get a message that the system undos your last transaction. </p>\n\n<p>In Git you have to type:</p>\n\n<p><code> $ git reset --soft HEAD^ </code></p>\n\n<p>So ok suppose you have an idea what reset is about. But in addition you have to know what "--soft" and "--hard" resets are (any intuitive guesses?). Oh and of course don\'t forget the \'^\' character in the end! (now what in Ritchie\'s name is that...)</p>\n\n<p>Mercurial\'s integration with 3rd party tools like kdiff3 and meld is much better as well. Generate your patches merge your branches without much fuss. Mercurial also includes a simple http server that you activate by typing </p>\n\n<p><code> hg serve </code></p>\n\n<p>And let others browse your repository.</p>\n\n<p>The bottom line is, Git does what Mercurial does, in a much more complicated way and with a far inferior CLI. Use Git if you want to turn the VCS of your project into a scientific-research field. Use Mercurial if you want to get the VCS job done without caring much about it, and focus on your real tasks. </p>\n'}]
['https://Stackoverflow.com/questions/35837', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3713/']