Mercurial is a distributed version control system (DVCS), like Git. It helps you track changes in source code, collaborate with others, roll back mistakes, and manage multiple versions of your project.
Why use Mercurial instead of git?
Here are some reasons someone would prefer Mercurial:Simplicity and consistency
Performance
Better history handling
Better for some workflows
Learning curve
Mercurial has a cleaner, more consistent command set than Git.
Example: hg log, hg status, hg commit are straightforward and uniform.
It was designed for very large repositories (big history, many commits).
Still fast today, especially for operations like history browsing.
Mercurial’s changesets are immutable, meaning you don’t rewrite history as easily as in Git.
That’s safer in collaborative environments where history rewriting is risky.
Some large projects (Mozilla, Python for many years, Facebook in parts) used Mercurial because it scaled well with big teams and repos.
Tools like SourceHut integrate with it.
Many people find Mercurial easier to teach to beginners compared to Git’s “plumbing vs porcelain” confusion.
Installation
Information about installation can be found at Mercurial's official webpage, you can reach it here.
Basic workflow
Configure Mercurial, as first step, you should teach Mercurial your name. For that you open the file ~/.hgrc (or mercurial.ini in your home directory for Windows) with a text-editor and add the ui section (user interaction) with your username:
[ui] username = Mr. Johnson <johnson@smith.com>Create new repository
hg init myproject cd myprojectAdd some files
echo "Hello Mercurial!" > hello.txt hg addCommit changes
hg commit -m "Initial commitSee repository status
hg status # modified/untracked files hg log # history of commits hg diff # see changesBranching
hg branch new-feature hg commit -m "Start new feature"Cloning & sharing
hg clone https://hg.sr.ht/~vdozer/website hg pull # get new changes hg push # send your changes
Links
For more detailed resources and information you can use these links:
If there are any issues/mistakes you can mail me at vdozer [at] tuta [dot] com.
Monero donations: 45sETv3BbWqi8BeaCjUtycE1UG4shMFefLKdtkziTBwY8NJUHA4zZjadK8Y7912UsZ92tP1C3FeDD8hTdtNKQxTdMjHuUL1 | Here is the QR.