Git vs Mercurial
From WikiVS, the open comparison website
Git and Mercurial are the two most popular Distributed Version Control Systems (DVCS).
Contents |
[edit] Design
Mercurial is claimed to be simpler and easier to learn than Git. However, Git is more flexible and powerful. Git provides more lower-level commands than Mercurial, allowing virtually direct access into the inner workings of the repository. Even so many of the same things are achievable with both.
[edit] Commands
| Git | Mercurial |
|---|---|
| git pull | hg fetch (Requires the FetchExtension to be enabled.) |
| git fetch | hg pull |
| git reset --hard | hg revert -a --no-backup |
| git revert <commit> | hg backout <cset> |
| git add <new_file> | hg add <new_file> (Only equivalent when <new_file> is not tracked.) |
| git add <file> | Not necessary in Mercurial. |
| git add -i | hg record (Requires the RecordExtension to be enabled.) |
| git commit --amend | hg qimport -r tip ; hg qrefresh -e ; hg qfinish tip (Requires the MqExtension.) |
| git blame | hg blame or hg annotate |
| git bisect | hg bisect |
| git rebase --interactive | hg histedit <base cset> (Requires the HisteditExtension.) |
| git stash | hg shelve (Requires the ShelveExtension or the AtticExtension.) |
| git merge | hg merge |
| git cherry-pick <commit> | hg import - (Transplant requires the TransplantExtension.) |
| git rebase <upstream> | hg rebase -d <cset> (Requires the RebaseExtension.) |
| git format-patch <commits> and git send-mail | hg email -r <csets> (Requires the PatchbombExtension.) |
| git am <mbox> | hg mimport -m <mbox> (Requires the MboxExtension and the MqExtension. Imports patches to mq.) |
[edit] Performance
Git is faster than Mercurial on Linux systems.
[edit] Philosophy
Git is based on the Unix philosophy of having one application provide one functionality. Git consists of 144 executable files that each do a certain job within a Git repository.
Mercurial, on the other hand, is one binary executable.
[edit] Licensing
Both Git and Mercurial are open-source projects.
[edit] Mainstream Support
GitHub provides free public Git repositories for open-source projects. This makes it easy to share code and collaborate on projects. Mercurial has Bitbucket.
Popular source hosting site, Source Forge, is planning on adding support for both revision control systems in the near future.
[edit] Development
Git is written in C. Mercurial is written in Python.
Git was created by Linus Torvalds for the purpose of maintaining the Linux source code repository.
[edit] Popularity
Git started its popularity by becoming the official version control system for the Linux Kernel. Even apart from the Linux Kernel, Git is quickly becoming popular among open-source hackers, and has already shown extreme popularity among Ruby programmers. Most Ruby projects are maintained in Git rather than in Mercurial.
The Python language's development has now been moved to Mercurial, and many projects written in Python are switching to it as well. Mozilla is now also using Mercurial for its various projects [1].
del.icio.us
digg
Furl
reddit
Slashdot