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

  • By
    How I Stopped WordPress Comment Spam

    I love almost every part of being a tech blogger:  learning, preaching, bantering, researching.  The one part about blogging that I absolutely loathe:  dealing with SPAM comments.  For the past two years, my blog has registered 8,000+ SPAM comments per day.  PER DAY.  Bloating my database...

  • By
    Convert XML to JSON with JavaScript

    If you follow me on Twitter, you know that I've been working on a super top secret mobile application using Appcelerator Titanium.  The experience has been great:  using JavaScript to create easy to write, easy to test, native mobile apps has been fun.  My...

Incredible Demos

  • By
    JavaScript Copy to Clipboard

    "Copy to clipboard" functionality is something we all use dozens of times daily but the client side API around it has always been lacking; some older APIs and browser implementations required a scary "are you sure?"-style dialog before the content would be copied to clipboard -- not great for...

  • By
    dwProgressBar v2:  Stepping and Events

    dwProgressBar was a huge hit when it debuted. For those of you who didn't catch my first post, dwProgressBar is a MooTools 1.2-based progress bar which allows for as much flexibility as possible. Every piece of dwProgressBar can be controlled by CSS...

Discussion

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