~/ Mercurial for Git Evangelists

I’ve been playing around with mercurial as of late as a way to enhance what I know about git and version control in general. These are my in-progress notes.

A lot of things are familiar

Revisions, not SHA1s

hg log is similar to git log, with a few important differences.

$ hg log --graph --style=compact
@  2[tip]   3afb761704c7   2014-12-06 11:14 -0500   jesse
|    third commit
|
o  1   2d9ef30807a4   2014-12-06 11:09 -0500   jesse
|    second commit
|
o  0   ff70fcdc63f9   2014-12-06 11:07 -0500   jesse
 initial commit

Instead of SHA1 hashes to label commits, mercurial uses revision numbers. This means reverting changes is easy as hg update 1 or hg update 0. The @ symbol indicates which revision your working directory is in, ie git’s HEAD.

Multiple HEADs

hg update feels a bit like git reset, but is less dangerous in terms of its ability to rewrite history.


~/ Posted by Jesse Shawl on 2014-12-08