mercurial .hgignore - won't ignore files
Asked Answered
U

1

6

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.

Ulyanovsk answered 1/2, 2010 at 14:36 Comment(0)
L
13

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.)

Lofty answered 1/2, 2010 at 14:39 Comment(1)
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!Ulyanovsk

© 2022 - 2024 — McMap. All rights reserved.