bytecode77
bytecode77

Reputation: 14830

.hgignore ignoring folders with exact names

This .hgignore file ignores the "bin" folders of Visual Studio solutions, which is good. But it also ignores all folders that ends with "bin", for example the folder "testbin".

syntax: glob
bin/

I tried ^/bin/, /bin/ and ^/bin/, but none of them seem to work.

I want to ignore all folders that are called exactly "bin". Not "123bin", or "bin123". How should I configure my .hgignore file?

Upvotes: 1

Views: 663

Answers (1)

Mathiasdm
Mathiasdm

Reputation: 1831

I believe this should work fine if you change the syntax to syntax: regexp. Glob syntax doesn't support rooting. Per hg help hgignore:

Neither glob nor regexp patterns are rooted. A glob-syntax pattern of the form *.c will match a file ending in .c in any directory, and a regexp pattern of the form .c$ will do the same. To root a regexp pattern, start it with ^.

Upvotes: 3

Related Questions