Does Mercurial have an equivalent to git clean? Does Mercurial have an equivalent to git clean? git git

Does Mercurial have an equivalent to git clean?


There is no equivalent to git clean in the core Mercurial package.

However, the hg purge extension does what you are after.

There is an open issue to make this extension part of the core package.


The extension is already included in mercurial, but you still have to activate it.

It's as simple as creating a .hgrc file in your home directory (e.g. Win 7: C:\Users\«yourusername»\.hgrc) and adding the following content to that file:

[extensions] purge =

(Home directory is ~/.hgrc for most other desktop operating systems (Unix, Gnu/Linux, Mac osx, BSD, etc.)


I don't use git for my repository management. However, if I were to guess, I think hg purge might be what you are seeking.