Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to hg forget what .hgignore lists?

I've tracked files I no longer want to track. So I've updated .hgignore but that doesn't result in them being forgotten. Other than manually hg forget each do I have other options?

like image 245
simpatico Avatar asked Feb 22 '23 10:02

simpatico


2 Answers

With Mercurial 2.0, you can specify a fileset for this! To forget the ignored files, use:

$ hg forget "set:hgignore() and not ignored()"
like image 54
Martin Geisler Avatar answered Mar 03 '23 21:03

Martin Geisler


I dont think there is another option.

You have already checked these files into Mercurial.After hg forget the .hgignore file will take effect and prevent them from being added again. More precisely, the .hgignore file will make hg status stop showing the files as untracked

Tracked files are never affected by the .hgignore file. Well hg addremove could help you. Take a look here.

like image 39
bilash.saha Avatar answered Mar 03 '23 23:03

bilash.saha