Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
up vote 11 down vote accepted

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.

share|improve this answer

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.

share|improve this answer

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

share|improve this answer

I believe you can simply ignore them by placing them in a .hgignore file in the folder.

http://www.selenic.com/mercurial/hgignore.5.html

share|improve this answer
1  
I've ignored them but they're already tracked in the repo and have changes so are showing up. – ghickman Jan 17 '11 at 16:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .