hg vs git

Which to use. I have been using hg for some small things for a little while and I really like how easy it is to use. The commands are easy enough to remember and they make sense with what it is that you are trying to do. That with the fact that it is really pretty fast make it a great tool to have. The only thing that I have found that is kind of annoying is that it complains with files over 10MB. Not sure where to change it to allow for files of this size.

A few of my friends have talked about git though. I have looked at the commands and they are really quite similar to the hg commands.

So I guess my question is what do you use and why. Is it worth it to switch to git from hg (or the other way even)?



  1. #1 by Rick Harding on August 11, 2008 - 4:17 pm

    any reason you’re not looking at bzr? It’s really close to hg, moves at a much faster pace it seems. The plugin arch is nice and there are some really great ones already out there. I’d suggest giving it a look.

  2. #2 by etank on August 11, 2008 - 4:20 pm

    @Rick I have looked at bzr and to be honest it seems slower than hg to me. And I want something that is cross platform (no cygwin if it can be helped). I don’t know if bzr is cross platform or not.

    /me goes to check.

  3. #3 by Tallken on August 11, 2008 - 4:42 pm

    bzr seems “feature cool” but used so much memory downloading a SVN repo (which, in bzr’s defense, was full of binary files) that cause that typical state of swapping memory to the disk in such a magnitude the mouse would jump on the screen.

    Git on the other hand handled it perfectly.

    Never tried Hg though.

  4. #4 by Henrik Johansson on August 11, 2008 - 4:46 pm

    Bzr is python based and its merging is really great. If i had not already decided i like bzr best i would for sure after some easy tests. Eclipse integration is nice too if you are so inclined…

  5. #5 by Vadi on August 11, 2008 - 4:47 pm

    “easier”? then bzr is the king of user-friendliness.

  6. #6 by Tom on August 11, 2008 - 5:36 pm

    Just learn the 7 git commands you really need and use it.
    It is fastest, best tested and original Linu(x|s) solution 😉
    I think we will see a open source world where all source control ( upstream & downstream ) is distributed and git seems to be winning the most mindshare, because it propagates down from the kernel to the distros etc.

    Just my 0.02€ though ..

    ( Oh, and if you use something else a certain someone will call you ugly and stupid :))

  7. #7 by zodman on August 11, 2008 - 5:51 pm

    You can test git.


  8. #8 by devnet on August 11, 2008 - 10:41 pm

    Checkout the Mozilla Foundation…it’s one of the most active codebases on the planet. Guess what they use for their version control? You guessed it, Hg 🙂 Some others that come to mind are ALSA, Audacious, Dovecot, IcedTea Java, NetBeans, MoinMoin, NTFS-3G, Fuse, wget, and ZFS (even Open Solaris for a few things).

    I guess it depends…most people will tout bzr because it’s what Ubuntu uses. Others will tout git because the kernel uses it. There are some features of hg that you DON’T have in the others so I’d weigh in on if those features are important to you or not.

  9. #9 by Robin on August 12, 2008 - 5:17 am

    Moz didn’t go for git because at the time it didn’t have good Windows compatibility. This is apparently a lot better now, and anyway I’d guess for most of the people commenting on this blog it’s not an issue anyway?

  10. #10 by Tom on August 12, 2008 - 5:25 am

    Well ..

    Checkout the Linux Kernel..it´s the most active codebase on the planet.
    Guess what they use for their version control? You guessed it, git. 😛

    But seriously: Checkout http://lwn.net/Articles/292726/ that is a good starting point and you will get opinions from people who really use git on a daily basis.

  11. #11 by etank on August 12, 2008 - 8:03 am


    Most of what I place on this blog has to do with Linux related things. However for may daytime job I am an Windows admin so I really want something that is cross platform. I don’t want to have to learn 2 different tools.

    So far hg has been fantastic (except for the 10MB thing). The downside that I have seen with git on Windows is that it wants to run in either cygwin or another Linux like env. I like that hg for Windows is an exe (wrapped python code) and just works. Since git is written in C why would it need the bash / sh env on Windows?

  12. #12 by Roopesh Chander on August 12, 2008 - 9:41 am

    hg was my first dvcs, but I’m taken to git now. Git lets you play with the repo like none other (you can modify commits/commit messages, collapse commits, undo commits …), but is somewhat trickier to use – takes some time to understand it’s concepts and terminologies (the downside is that you are forced to understand them before you can start using git effectively). Hg doesnt really let you change the repo (except add stuff), but it’s ui is more direct, and it’s error messages understandable. (eg. to undo local modifications, you do “hg revert” but you gotta do “git checkout master .”). And, yes, setting up git on windows is a pain.

  13. #13 by EtienneG on August 12, 2008 - 9:43 am

    If hosting your code on Launchpad is anywhere on your radar, then Bazaar it is.

  14. #14 by mathew on August 12, 2008 - 2:20 pm

    I use bzr, ’cause I like a simple UI.

    Also, I generally distrust Linus’s judgement on VCS systems, since he has been so disastrously wrong in the past.

  15. #15 by dhruva on August 19, 2008 - 2:52 am

    I have used a bunch of dVCS: svn/svk, git, bzr, hg, gnu arch..

    For simplicity and portability: hg (got it running on OpenVMS too)
    For raw speed: git/hg
    For clean UI, extensions and a truly humble development community (and true GNU/FSF support): bzr
    For good interoperability support: git (followed by bzr). Both have fast-import in place and can talk seamlessly with SVN.
    For a perl pro willing to do some dirty hacking: svk (sits on top of svn, could talk to perforce seamlessly)

    After all this, if you are still confused (like I am), head for hg/bzr (easy to start, you can always convert your repo to other dVCS when you pick it up)

  16. #16 by etank on August 19, 2008 - 8:07 am


    Thanks for the rundown. I guess for now I will stick to hg. If I ever do switch I think that I will head over to git land since it seems the closest to what I am already (somewhat) used to.

  17. #17 by Soyeb on July 14, 2009 - 4:54 am

    I’ve been using dVCS for nearly a decade now. I started on cmsynergy. I moved over to hg a few years ago, and over the last few months I’ve been using git.

    cmsynergy is great but ridiculously expensive.

    git is very capable, but is in my opinion made awkward to use because of what I would argue are unnecessary features for almost every project. Linus said he created git to make his job easier, but making his job easier introduces features such as undo commits which should not be in a vcs.

    hg gives almost identical features to the previous two, including the ability to collapse commits/checkpoint (an excellent feature that is underused by developers). And all this with an intuitive and easy to use set of commands.

    I’ll be going back to hg for my next project.

  18. #18 by rozgo on August 28, 2009 - 4:23 pm

    git does branches extremely fast and easy

    i never trusted my code to branches/merges before, until i started with git

    we develop games and have a master game engine with branches and subbranches for each game… we then merge the best features of each game between games and sometimes back to master

    sounds weird at first but this is how it naturally evolved 🙂

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: