views:

1092

answers:

1

Hi - I'm trying to ignore a file in my project with .hgignore, and just can't figure it out. The file is located in app/views/patterns/_changes.erb (relative to the root of the project, where .hgignore is), and nothing I try seem to work:

#.hgignore
syntax: glob
app/views/patterns/_changes.erb
*changes.erb
public/files/* # this works

I read the .hgignore doesn't distinguish between folders and files, but can't really make it happen. Any clue? thanks.

+5  A: 

If you just put:

_changes.erb

as an entry, that should work. It will ignore that file name, regardless of location. Note that if the file is already in the repository, it won't REMOVE it... it just won't prompt you to add it next time it sees a file with that name.

As a side note, if you want to remove a file from version control, use the command:

hg forget _changes.erb

(Note that this will remove the file from the current revision onwards. The file will always remain in past changesets -- i.e. it's not a total purge of the file.)

Henry Jackson
you're right, I've modified my .hgignore per your suggestion, removed the file from the tree and re-created it. Afterwards, it didn't prompt me to add it again. Thanks!
sa125