Is it possible to delete all untracked files from my working directory? Let\'s say I added a bunch of files to my working directory, didn\'t add them via \'hg add\' and now want
This should do the trick:
hg status | grep '^\?' | sed 's/^\? //' | xargs rm -rf
The proper way without purge is:
hg st -un0 | xargs -0 rm
if you don't want to use purge:
rm $(hg st | grep ^? | awk '{print $2}')
You can use
hg purge --all
to remove all the ignored and untracked files
(first you need to install the purge extension as explained in some answers)