The working directory of a Mercurial repository will often contain files that should not be tracked by Mercurial. These include backup files created by editors and build products created by compilers. These files can be ignored by listing them in a . hgignore file in the root of the working directory.
hgignore file sits in the working directory, next to the . hg folder. It is a file versioned as any other versioned file in the working directory, which is used to hold the content of the ignore patterns that are used for any command operating on the working directory.
Alternately:
syntax: glob
bin/**
I did some experiments and I found that the regex syntax on Windows applies to the path starting with the current repository, with backslashes transformed to slashes.
So if your repository is in E:\Dev for example, hg status
will apply the patterns against foo/bar/file1.c and such. Anchors apply to this path.
So:
I hope this will help, I found the HGIGNORE(5) page a bit succinct.
Both of those will also filter out a directory called cabin
, which might not be what you want. If you're filtering top-level, you can use:
^/bin/
For bin
directories below your root, you can omit the ^. There is no need to specify syntax, regexp is the default.
syntax: glob bin/**
This answer is shown above, however I'd also like to add that * and ** are handled differently. ** is recursive, * is not.
See Hg Patterns
Nevermind, I got it
syntax: regexp
bin\\*
expressions follow standard perl regular expression syntax.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With