Short list of mercurial cheat sheets

I'm using git scm for work and pet project quite long time. If wikipedia doesn't lie, first release of git was in 2005. If i remember correctly, than I am using git since 2009. I knew about git at github :). Two weeks ago I watched classic presentation Linus Torvalds on git. There was a quote:
Hg (Mercurial) is pretty good, but git is better
It was not my first time that I heard Mercurial name. Yes, i head it many times in my life. But unfortunatelly i never used it. I was curious about this dvcs and i decided little plunge into it. Today i finished to read: Mercurial: The Definitive Guide by Bryan O'Sullivan:
It is a really great book, where Bryan describes work with mercural from the start (how to install it, hot to create mercurial repository etc...) to advanced themes (hg hooks, worksflows and etc...). I have no big expirience with mercurial but i had noticed two things for this time:
  • It is much easier than git
  • It is much slower than git
In other parts mercurial similar to git, same commands commit, init, tag and etc...

List of useful mercurial commands

Here is little list of mercurial cheat sheets for mercurial begginers as me: To clone remote mercurial repo to local Dir directory:
hg clone remote Dir
To initialize new mercurial repository in current directory:
hg init
Begin tracking all files
hg add
Begin tracking file test
hg add test
Stop tracking and delete file test
hg remove test
Make commit with message to current repository
hg commit -m "message..."
Show history of changes
hg log
Show status of files
hg status
See who changed, what changed and when
hg annotate file
Lists known remote Repos
hg paths
Lists tracked file changes
hg diff
List changes to test file
hg diff test
List changesets available at remote
hg incoming
Pull all new changesets into local, but does not update work tree
hg pull
Pull all new changesets into local, and update work tree
hg pull -u
Merge working directory with another revision
hg merge
Undo all uncomm­itted changes
hg revert
Push changesets to remote
hg push
To create a new named branch
hg branch feature

No comments: