How to hgignore all subfolders but not the file in a folder?
I am looking to use n开发者_JAVA技巧uget without committing the packages. I want to ignore in mercurial all packages subfolder that are located in the /packages/
folder, but I do not want to exclude the repositories.config
file located in the /packages/
folder.
How should I write the exclusion regex to do that?
Can't you just do this:
hg add packages/repositories.config
And then have this in your .hgignore file
syntax: glob
packages
?
syntax: regexp
packages/(?!repositories.config).*
[source]
For ignore all jpg files with subdirectories in folder images:
^images/.*\.jpg$
精彩评论