Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

4 Answers

up vote 9 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
add comment

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
add comment

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
add comment

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.