How to Delete Untracked Files in a Mercurial Repository

By  on  

Working around Firefox at Mozilla means that you need to get acquainted with mercurial, the version control system that rivals git and svn.  Like any tool, hg (mercurial) can be difficult until you're well versed with it.  And if you hg import a URL that doesn't match up with what's in the repo, you'll get a bunch of *.rej files that in your directory structure that show up every time you hg status.  Gross.

If you want to start from scratch and remove all those unwanted files, there are two steps.  The first step is enabling the purge extension within your ~/.hgrc file:

[extensions]
purge=

With the purge extension available, it's as easy as running hg purge to get rid of all of the unwanted files:

hg purge

With those unwanted files gone, it's easy to get back to the business of being productive with as few useless obstructions getting in your way!

Recent Features

Incredible Demos

  • By
    TextboxList for MooTools and jQuery by Guillermo Rauch

    I'll be honest with you: I still haven't figured out if I like my MooTools teammate Guillermo Rauch. He's got a lot stacked up against him. He's from Argentina so I get IM'ed about 10 times a day about how great Lionel...

  • By
    GitHub-Style Sliding Links

    GitHub seems to change a lot but not really change at all, if that makes any sense; the updates come often but are always fairly small. I spotted one of the most recent updates on the pull request page. Links to long branch...

Discussion

    Wrap your code in <pre class="{language}"></pre> tags, link to a GitHub gist, JSFiddle fiddle, or CodePen pen to embed!