In my project's .hgignore
, I want to exclude /static/
(i.e., the static folder at the root of the directory), but not /templates/static/
. How would I configure .hgignore
to allow this?
Introduction The .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.
These files can be ignored by listing them in a .hgignore file in the root of the working directory. The .hgignore file must be created manually.
The Mercurial system uses a file called .hgignore in the root directory of a repository to control its behavior when it searches for files that it is not currently tracking. The working directory of a Mercurial repository will often contain files that should not be tracked by Mercurial.
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. The .hgignore file must be created manually.
You can include syntax: regexp
at the beginning of .hgignore and then use perl regex syntax to root a directory by using ^
. So just ^static
should do the work.
As of Mercurial 4.9, you can use syntax: rootglob
to insert rooted glob patterns.
New rootglob: filename pattern for a glob that is rooted at the root of the repository. See hg help patterns and hg help hgignore for details
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