terça-feira, 12 de julho de 2016

How to delete all untracked or ignored files from Mercurial

Is it possible to delete all untracked and ignored files from a Mercurial working directory easily.

LINUX


In linux the best way is use the PowerShell command: "hg st -un0 | xargs -0 rm"

WINDOWS


In windows add the Mercurial Extension called purge. It is distributed by Mercurial.
This extension adds a “purge” command to “hg” that removes files not known to Mercurial. i.e. untracked Files. So your command would be,
It is not enabled by default, maybe to avoid accidentally removing files that you forgot to add.
To install this extension, add this to your mercurial settings file (.hgrc on Unix, Mercurial.ini on Windows)
[extensions]
purge =
hg purge --all will delete all un-tracked and ignored files. This is useful for cleaning up in-source builds

Nenhum comentário:

Postar um comentário