Search code examples
mercurialhgignore

Mercurial .hgignore: Some questions on how to ignore a single file


There's a particular file in my repository, libraries/database.php, that I need ignored. However, I can't get the syntax to recognize the file - I've tried **/libraries/**/database.php and libraries/database.php in glob, and ^.libraries/database.php in regex, but neither of them work. What should I do?


Solution

  • syntax: re
    ^libraries/database\.php$
    

    That will work.

    But, frankly, I've always found the .hgignore syntax to be a little obscure myself. I don't really understand what glob will and won't match.