简体   繁体   中英

mercurial .hgignore - won't ignore files

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.

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 -- ie it's not a total purge of the file.)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM