Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can Mercurial use .hgignore to forget files?

Tags:

mercurial

I forget to place the correct .hgignore into my project and am now confronted with many useless files in my repository. As these files are already under source control .hgignore will not pick em up.

Is there a way for hg to forget all files matched by .hgignore?

like image 803
OliverS Avatar asked Jul 23 '10 07:07

OliverS


People also ask

What is hgignore file?

The . hgignore file sits in the working directory, next to the . hg folder. It is a file versioned as any other versioned file in the working directory, which is used to hold the content of the ignore patterns that are used for any command operating on the working directory.

What is HG status?

hg status shows the status of a repository. Files are stored in a project's working directory (which users see), and the local repository (where committed snapshots are permanently recorded). hg add tells Mercurial to track files. hg commit creates a snapshot of the changes to 1 or more files in the local repository.


1 Answers

filesets awesomeness (requires 1.9):

hg forget "set:hgignore() and not ignored()" 
like image 126
Idan K Avatar answered Oct 11 '22 14:10

Idan K