Can you remove a file from Mercurial without removing it from the filesystem like Git?

I've got some files in a repo that I don't want tracked, is it possible to remove them without removing the actual files from the filesystem?

This would be equivalent to git's rm --cached.


You can use hg forget <file> if files have just been added, however if the files have already been committed use hg rm --after <file>.

The help is a bit misleading, it should be hg rm --do-not-touch-the-filesystem.


It looks like hg forget is what I was looking for according to this.

This will mark a file so that it is no longer tracked after the next commit.


If you need to remove the file from Mercurial history as well, here's a stackoverflow question on how you do this: https://stackoverflow.com/questions/3558365/mercurial-remove-file-from-all-changesets/