Git and Mercurial are both free software tools for distributed revision control and software source code management.

Both Git and Mercurial were started at approximately the same time with similar aims. The immediate stimulus was the announcement in April 2005 by Bitmover that they were withdrawing the free version of BitKeeper, which had been used for the version control requirements of the Linux kernel project. Mercurial creator Matt Mackall decided to write a distributed version control system as a replacement for use with the Linux kernel. Mackall first announced Mercurial on April 19, 2005.

Git was created by Linus Torvalds for Linux kernel development, with an emphasis on being fast. The development of Git began on April 3, 2005. The project was announced on April 6, and became self-hosting as of April 7. The first merge of multiple branches was done on April 18.

The Linux kernel project decided to use Git rather than Mercurial, but Mercurial is now used by many other projects.

Comparison chart

Git versus Mercurial comparison chart
Edit this comparison chartGitMercurial
  • current rating is 3.95/5
  • 1
  • 2
  • 3
  • 4
  • 5
(110 ratings)
  • current rating is 4.15/5
  • 1
  • 2
  • 3
  • 4
  • 5
(110 ratings)
Built-in web server No Yes
Pre/post-event hooks Yes Yes
End of line conversions Yes Yes
Tags Yes Yes
International support Partial Yes
File renames Yes (implicit) Yes
Merge file renames Yes Yes
Symbolic links Yes Yes
Open source Yes Yes
Signed Revisions Yes Yes
Revision IDs SHA-1 hashes Numbers, SHA-1 hashes
Atomic commits Yes Yes
History model Snapshot Changeset
Repository size O(patch) (Big O notation) O(patch) (Big O notation)
Concurrency model Merge Merge
Operating Systems Unix-like, Windows, Mac OS X Unix-like, Windows, Mac OS X
Staging area Yes No
Externals branch Yes No
Cost Free Free
RCS Keyword Yes, but not recommended via bundled plugin
Shallow checkout / clone Yes Bugzilla extension
File/dir name tracking Rename detection Rename tracking
Subdirectory checkout/clone No No
Repository model Distributed Distributed
Permission keeping Execution bit only Execution bit only
Network protocols custom, custom over ssh, rsync, HTTP, email bundles HTTP, custom over ssh, email bundles (with standard plugin)
Developed by Junio Hamano, Linus Torvalds Matt Mackall
Maintained by Junio Hamano Matt Mackall
Written in C, Bourne Shell, Perl Python and C
Merge tracking Yes Yes
Bug Tracker integration No Trac (via plugin)
License GPL v2 GPL v2
OS POSIX, worse Windows support Unix-like, Windows, Mac OS X
Introduction (from Wikipedia) Git is a free distributed revision control, or software source code management project with an emphasis on being fast. Git was initially created by Linus Torvalds for Linux kernel development. Mercurial is a cross-platform, distributed revision control tool for software developers. It is mainly implemented using the Python programming language, but includes a binary diff implementation written in C.
Type Revision control Revision control

Design goals

Mercurial's major design goals include high performance, scalability, being a serverless, fully distributed collaborative development, robust handling of both plain text and binary files, and advanced branching and merging capabilities, while remaining conceptually simple. It includes an integrated web interface.

One of Linus Torvalds' key design goals for Git was speed and efficiency of operations. Other design criteria included strong safeguards against corruption, either accidental or malicious.

Projects using Git vs Projects using Mercurial

Several high-profile software projects now use Git for revision control, most notably the Linux kernel, Perl, Samba, Server, Qt (toolkit), One Laptop per Child (OLPC) core development, Ruby on Rails web framework, VLC, YUI, Merb, Wine, SWI Prolog, GNOME, GStreamer, DragonFly BSD and the Android mobile platform.

Projects using Mercurial include Adblock Plus, Aldrin, Audacious, Dovecot IMAP server, GNU Octave, NxOS, Nuxeo, Growl, MoinMoin wiki software, Mozilla, Mutt (email client), Netbeans (IDE), OpenJDK, Python, SAGE, Sun Microsystem's OpenSolaris and Oracle's Opensource Software like Btrfs.

Git vs Mercurial Portability

Mercurial was initially written to run on Linux. It has been ported to Windows, Mac OS X, and most other Unix-like systems. Mercurial is primarily a command line program.

Git is primarily developed on Linux, but can be used on other Unix-like operating systems including BSD and Solaris.

Git also runs on Windows. There are two variants:

User Interface for Git vs Mercurial

All of Mercurial's operations are invoked as keyword options to its driver program hg, a reference to the chemical symbol of the element mercury. GUI interfaces for Mercurial include Hgk (Tcl/Tk). This is implemented as a Mercurial extension, and is part of the official version. This viewer displays the directed acyclic graph of the changesets of a Mercurial repository. This viewer can be invoked via the command 'hg view', if the extension is enabled. hgk was originally based on a similar tool for git called gitk. There is hgk replacement named hgview that is written in pure python and provides both gtk and qt interfaces.

Related Mercurial tools include:

Alternatives for running Git using a GUI include:


Share this comparison:

If you read this far, you should follow us:

"Mercurial vs Git." Diffen LLC, n.d. Web. 9 Nov 2022. < >