version-controlmercurialtortoisehghgignore

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!


Solution

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

    See in action:

    See also: