Mercurial vs Git - Difference and Comparison

April 2022 · 5 minute read

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

Differences Similarities

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 serverNoYes
Pre/post-event hooksYesYes
End of line conversionsYesYes
TagsYesYes
International supportPartialYes
File renamesYes (implicit)Yes
Merge file renamesYesYes
Symbolic linksYesYes
Open sourceYesYes
Signed RevisionsYesYes
Revision IDsSHA-1 hashesNumbers, SHA-1 hashes
Atomic commitsYesYes
History modelSnapshotChangeset
Repository sizeO(patch) (Big O notation)O(patch) (Big O notation)
Concurrency modelMergeMerge
Operating SystemsUnix-like, Windows, Mac OS XUnix-like, Windows, Mac OS X
Staging areaYesNo
Externals branchYesNo
CostFreeFree
RCS KeywordYes, but not recommendedvia bundled plugin
Shallow checkout / cloneYesBugzilla extension
File/dir name trackingRename detectionRename tracking
Subdirectory checkout/cloneNoNo
Repository modelDistributedDistributed
Permission keepingExecution bit onlyExecution bit only
Network protocolscustom, custom over ssh, rsync, HTTP, email bundlesHTTP, custom over ssh, email bundles (with standard plugin)
Developed byJunio Hamano, Linus TorvaldsMatt Mackall
Maintained byJunio HamanoMatt Mackall
Written inC, Bourne Shell, PerlPython and C
Merge trackingYesYes
Bug Tracker integrationNoTrac (via plugin)
LicenseGPL v2GPL v2
Websitegit-scm.comwww.selenic.com/mercurial
OSPOSIX, worse Windows supportUnix-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.
TypeRevision controlRevision 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, X.org 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:

Related Videos

References

Share this comparison:

If you read this far, you should follow us:

"Mercurial vs Git." Diffen.com. Diffen LLC, n.d. Web. 23 Jun 2022. < >

ncG1vNJzZmivp6x7pbXFn5ynZpOkunCwyJ%2BdnqqVo7Cme6aiq2auo2Kapr7CrqmimZw%3D