Need advice about which tool to choose?Ask the StackShare community!

Git

287.6K
173K
+ 1
6.6K
Mercurial

229
216
+ 1
105
Add tool

Git vs Mercurial: What are the differences?

Git and Mercurial are both distributed version control systems (DVCS) that offer functionalities for managing source code. Here are the key differences between Git and Mercurial:

  1. Architecture: Git uses a content-addressable filesystem, where each file is identified by its content hash, and commits are represented as directed acyclic graphs. On the other hand, Mercurial uses a simpler model with changesets that directly track changes to files. This architectural difference impacts how they handle branching, merging, and storage efficiency.

  2. Performance: Git is known for its exceptional performance, especially when it comes to handling large repositories and performing operations like branching and merging. Mercurial, while still performant, may be slightly slower in certain operations due to its different architecture and algorithms.

  3. Learning Curve: Git has a steeper learning curve compared to Mercurial. Git's command-line interface and terminology can be initially challenging for new users. Mercurial, on the other hand, aims for a simpler and more intuitive command set, making it more approachable for beginners or those transitioning from other version control systems.

  4. Ecosystem and Adoption: Git has gained widespread adoption and has a larger ecosystem compared to Mercurial. It is the de facto standard for version control in many open-source projects and industry workflows. Git has an extensive collection of third-party tools, integrations, and hosting platforms like GitHub, GitLab, and Bitbucket. While Mercurial also has its ecosystem and hosting platforms like Bitbucket, it has a smaller community and user base overall.

  5. Windows Compatibility: Git has native support for Windows, making it a popular choice for developers working in Windows environments. Mercurial also supports Windows, but historically, Git has provided better compatibility and performance on this platform.

In summary, Git's widespread adoption and robust tooling make it a popular choice for many developers, while Mercurial's simpler command set and intuitive design may appeal to beginners or those looking for an alternative version control system.

Decisions about Git and Mercurial
Kamaldeep Singh

SVN is much simpler than git for the simple stuff (checking in files and updating them when everyone's online), and much more complex than git for the complicated stuff (branching and merging). Or put another way, git's learning curve is steep up front, and then increases moderately as you do weird things; SVN's learning curve is very shallow up front and then increases rapidly.

If you're storing large files, if you're not branching, if you're not storing source code, and if your team is happy with SVN and the workflow you have, I'd say you should stay on SVN.

If you're writing source code with a relatively modern development practice (developers doing local builds and tests, pre-commit code reviews, preferably automated testing, preferably some amount of open-source code), you should move to git for two reasons: first, this style of working inherently requires frequent branching and merging, and second, your ability to interact with outside projects is easier if you're all comfortable with git instead of snapshotting the outside project into SVN.

See more
Get Advice from developers at your company using StackShare Enterprise. Sign up for StackShare Enterprise.
Learn More
Pros of Git
Pros of Mercurial
  • 1.4K
    Distributed version control system
  • 1.1K
    Efficient branching and merging
  • 959
    Fast
  • 845
    Open source
  • 726
    Better than svn
  • 368
    Great command-line application
  • 306
    Simple
  • 291
    Free
  • 232
    Easy to use
  • 222
    Does not require server
  • 27
    Distributed
  • 22
    Small & Fast
  • 18
    Feature based workflow
  • 15
    Staging Area
  • 13
    Most wide-spread VSC
  • 11
    Role-based codelines
  • 11
    Disposable Experimentation
  • 7
    Frictionless Context Switching
  • 6
    Data Assurance
  • 5
    Efficient
  • 4
    Just awesome
  • 3
    Github integration
  • 3
    Easy branching and merging
  • 2
    Compatible
  • 2
    Flexible
  • 2
    Possible to lose history and commits
  • 1
    Rebase supported natively; reflog; access to plumbing
  • 1
    Light
  • 1
    Team Integration
  • 1
    Fast, scalable, distributed revision control system
  • 1
    Easy
  • 1
    Flexible, easy, Safe, and fast
  • 1
    CLI is great, but the GUI tools are awesome
  • 1
    It's what you do
  • 0
    Phinx
  • 18
    A lot easier to extend than git
  • 17
    Easy-to-grasp system with nice tools
  • 13
    Works on windows natively without cygwin nonsense
  • 11
    Written in python
  • 9
    Free
  • 8
    Fast
  • 6
    Better than Git
  • 6
    Best GUI
  • 4
    Better than svn
  • 2
    Hg inc
  • 2
    Good user experience
  • 2
    TortoiseHg - Unified free gui for all platforms
  • 2
    Consistent UI
  • 2
    Easy-to-use
  • 2
    Native support to all platforms
  • 1
    Free to use

Sign up to add or upvote prosMake informed product decisions

Cons of Git
Cons of Mercurial
  • 16
    Hard to learn
  • 11
    Inconsistent command line interface
  • 9
    Easy to lose uncommitted work
  • 7
    Worst documentation ever possibly made
  • 5
    Awful merge handling
  • 3
    Unexistent preventive security flows
  • 3
    Rebase hell
  • 2
    When --force is disabled, cannot rebase
  • 2
    Ironically even die-hard supporters screw up badly
  • 1
    Doesn't scale for big data
  • 0
    Track single upstream only
  • 0
    Does not distinguish between local and remote head

Sign up to add or upvote consMake informed product decisions

- No public GitHub repository available -

What is Git?

Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.

What is Mercurial?

Mercurial is dedicated to speed and efficiency with a sane user interface. It is written in Python. Mercurial's implementation and data structures are designed to be fast. You can generate diffs between revisions, or jump back in time within seconds.

Need advice about which tool to choose?Ask the StackShare community!

What companies use Git?
What companies use Mercurial?
See which teams inside your own company are using Git or Mercurial.
Sign up for StackShare EnterpriseLearn More

Sign up to get full access to all the companiesMake informed product decisions

What tools integrate with Git?
What tools integrate with Mercurial?

Sign up to get full access to all the tool integrationsMake informed product decisions

Blog Posts

Mar 24 2021 at 12:57PM

Pinterest

GitJenkinsKafka+7
3
2135
GitJenkinsGroovy+4
4
2641
GitCloudBees+2
3
4429
Git.NETCloudBees+3
6
1065
Mar 4 2020 at 5:14PM

Atlassian

GitBitbucketWindows+4
3
1036
GitNode.jsFirebase+5
7
2352
What are some alternatives to Git and Mercurial?
GitHub
GitHub is the best place to share code with friends, co-workers, classmates, and complete strangers. Over three million people use GitHub to build amazing things together.
SVN (Subversion)
Subversion exists to be universally recognized and adopted as an open-source, centralized version control system characterized by its reliability as a safe haven for valuable data; the simplicity of its model and usage; and its ability to support the needs of a wide variety of users and projects, from individuals to large-scale enterprise operations.
Bitbucket
Bitbucket gives teams one place to plan projects, collaborate on code, test and deploy, all with free private Git repositories. Teams choose Bitbucket because it has a superior Jira integration, built-in CI/CD, & is free for up to 5 users.
Perforce
Visibility, access control, workflow and code management for Git environments. Flexibility of collaborating on the same codebase and code reviews using any combination of Perforce and Git workflows and tools without compromise.
GitLab
GitLab offers git repository management, code reviews, issue tracking, activity feeds and wikis. Enterprises install GitLab on-premise and connect it with LDAP and Active Directory servers for secure authentication and authorization. A single GitLab server can handle more than 25,000 users but it is also possible to create a high availability setup with multiple active servers.
See all alternatives