Skip to content

Remove untracked files in Mercurial

by Tomek on June 2nd, 2011

It happens after wild act of creation that we notice we went wrong way. Quick decision is made: "go back and start over". With VCS it is plain simple, just type hg revert and you're at home. Almost. Unsurprisingly, hg revert reverts only modifications and leaves new files intact.

There is simple solution for that: and there's again nice, but obscure feature that is included in the box, but just not activated. Let's edit the .hgrc in your home directory, and make sure there is something like this:

[extensions]
purge =

and once it is, just type

hg purge

to send unwanted files to /dev/null.

From → dvcs, mercurial

No comments yet

Leave a Reply

Note: XHTML is allowed. Your email address will never be published.

Subscribe to this comment feed via RSS

Comment spam protected by SpamBam