Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Applying hgignore file to already committed file Mercurial repo

Trying to do something similar to here: Applying .gitignore to committed files

Where you apply the new hgignore file to the already committed files.

I have node_modules folder already committed with thousands of files and I'd like to remove it by using the new hgignore file.

I can't find anything online for it to work on a Mercurial repo, any ideas? Thanks!

like image 739
Imdad Avatar asked Aug 10 '17 08:08

Imdad


1 Answers

  1. Edit .hgignore to match files you want to ignore
  2. hg forget "set:hgignore()" and commit

See in action:

  • https://asciinema.org/a/kuJERsouDkOUBspADjDM5pMRQ

See also:

  • hg remove all files listed in .hgignore
  • How to check which files are being ignored because of .hgignore?
like image 64
santiagopim Avatar answered Sep 18 '22 20:09

santiagopim