Need advice about which tool to choose?Ask the StackShare community!
Git vs Mercurial vs SVN (Subversion): What are the differences?
Key differences between Git and Mercurial and SVN (Subversion): 1. Distributed Architecture: Git and Mercurial both have a distributed architecture where each developer has a complete copy of the repository. This allows developers to work offline and independently, contributing to a faster and more efficient workflow. On the other hand, SVN follows a centralized architecture, where there is a single repository and developers need to be connected to the server to access the code. This can result in slower operations and limited offline capabilities.
Branching and Merging: Git and Mercurial provide more advanced and flexible branching and merging capabilities compared to SVN. Both Git and Mercurial use lightweight branches, allowing developers to easily create and switch between branches for different features or experiments. They also offer efficient merging algorithms that can handle complex merge scenarios. In contrast, SVN uses heavy branches that are more time-consuming to create and switch between. Merging in SVN can be more error-prone and manual.
Performance: Git and Mercurial tend to have faster performance compared to SVN, especially when it comes to operations such as committing, branching, and merging. This is because Git and Mercurial use local repositories and store changes as lightweight branches, whereas SVN requires communication with a central server for most operations. This can result in slower response times and decreased productivity for larger teams working with SVN.
Ease of Use: Git and Mercurial are often considered more user-friendly compared to SVN. Both Git and Mercurial have intuitive command-line interfaces and provide graphical user interface (GUI) tools for ease of use. They also have better support for features like renaming files, moving files, and handling binary files. In contrast, SVN commands can be more complex and less intuitive, requiring a steeper learning curve for new users.
Community and Ecosystem: Git has a larger community and a more extensive ecosystem compared to Mercurial and SVN. Git is widely adopted and supported by popular hosting platforms like GitHub and GitLab, which provide additional collaboration features and integrations with other tools. Mercurial has a smaller but still active community, while SVN has a more niche user base. The larger community around Git means there is a greater availability of resources, tutorials, and support.
Data Integrity: Git and Mercurial have strong mechanisms to ensure data integrity, as they use cryptographic hashes to verify the integrity of each commit in the repository. This means that it is nearly impossible to tamper with or lose data in these systems. SVN, on the other hand, does not have built-in cryptographic hashes, making it more vulnerable to data corruption or tampering.
In summary, Git and Mercurial provide a more distributed architecture, advanced branching and merging capabilities, better performance, user-friendliness, and a larger community compared to SVN. They also have stronger data integrity mechanisms.
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.
Pros of Git
- Distributed version control system1.4K
- Efficient branching and merging1.1K
- Fast959
- Open source845
- Better than svn726
- Great command-line application368
- Simple306
- Free291
- Easy to use232
- Does not require server222
- Distributed27
- Small & Fast22
- Feature based workflow18
- Staging Area15
- Most wide-spread VSC13
- Role-based codelines11
- Disposable Experimentation11
- Frictionless Context Switching7
- Data Assurance6
- Efficient5
- Just awesome4
- Github integration3
- Easy branching and merging3
- Compatible2
- Flexible2
- Possible to lose history and commits2
- Rebase supported natively; reflog; access to plumbing1
- Light1
- Team Integration1
- Fast, scalable, distributed revision control system1
- Easy1
- Flexible, easy, Safe, and fast1
- CLI is great, but the GUI tools are awesome1
- It's what you do1
- Phinx0
Pros of Mercurial
- A lot easier to extend than git18
- Easy-to-grasp system with nice tools17
- Works on windows natively without cygwin nonsense13
- Written in python11
- Free9
- Fast8
- Better than Git6
- Best GUI6
- Better than svn4
- Hg inc2
- Good user experience2
- TortoiseHg - Unified free gui for all platforms2
- Consistent UI2
- Easy-to-use2
- Native support to all platforms2
- Free to use1
Pros of SVN (Subversion)
- Easy to use20
- Simple code versioning13
- User/Access Management5
- Complicated code versionioning by Subversion3
- Free2
Sign up to add or upvote prosMake informed product decisions
Cons of Git
- Hard to learn16
- Inconsistent command line interface11
- Easy to lose uncommitted work9
- Worst documentation ever possibly made8
- Awful merge handling5
- Unexistent preventive security flows3
- Rebase hell3
- Ironically even die-hard supporters screw up badly2
- When --force is disabled, cannot rebase2
- Doesn't scale for big data1
Cons of Mercurial
- Track single upstream only0
- Does not distinguish between local and remote head0
Cons of SVN (Subversion)
- Branching and tagging use tons of disk space7