Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Mercurial have an equivalent to git clean?

Tags:

git

mercurial

hg clean does not seem to exist, which kinda bothers me. Is this a feature that Mercurial doesn't have or did they just name it differently?

like image 473
Erik B Avatar asked May 03 '10 18:05

Erik B


People also ask

Why Mercurial is better than Git?

Mercurial's big advantage is that it's easy to learn and use, which is useful for less-technical content contributors. In the Git vs. Mercurial debate, Git is the clear choice for pure web and mobile-application development.

What is hg in Git?

This is the Hg-Git plugin for Mercurial, adding the ability to push to and pull from a Git server repository from Mercurial. The Big Idea. The Hg-Git plugin can convert commits/changesets losslessly from one system to another, so you can push via a Mercurial repository and another Mercurial client can pull it.

What is hg purge?

hg purge --all will delete all un-tracked and ignored files. This is useful for cleaning up in-source builds.


2 Answers

There is no equivalent to git clean in the core Mercurial package.

However, the hg purge extension does what you are after.

There is an open issue to make this extension part of the core package.

like image 181
Tim Henigan Avatar answered Oct 02 '22 10:10

Tim Henigan


The extension is already included in mercurial, but you still have to activate it.

It's as simple as creating a .hgrc file in your home directory (e.g. Win 7: C:\Users\«yourusername»\.hgrc) and adding the following content to that file:

[extensions]  purge = 

(Home directory is ~/.hgrc for most other desktop operating systems (Unix, Gnu/Linux, Mac osx, BSD, etc.)

like image 44
MIWMIB Avatar answered Oct 02 '22 09:10

MIWMIB