mercurialhgignore

hg - Ignore directory at root only


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?


Solution

  • 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.