Mercurial on Windows does not see .hgignore - why?

Windows cannot pick up my .hgignore file. I run Mercurial from the command line and the β€œhg status” shows a lot of files in ignored directories.

The .hgignore file looks like this (there are no spaces at the beginning of the file or at the beginning of each line). I put it in the root directory of the repository.

\.pyc$ \.pyo$ \.DS_Store \.Python \.installed.cfg ^bin$ ^build$ ^develop-eggs$ ^eggs$ ^include$ ^lib$ ^parts$ ^pip-log.txt$ ^web/localsettings.py$ 

I tried to save the file in ANSI and UTF-8, and it does not seem to matter.

I know the file works fine on Linux, is there anything else in the paths on Windows?

+4
source share
3 answers

"hg status" shows many files in ignored directories

Are you referring exclusively to .DS_Store and .Python? The rule for ^ bin $ will ignore entries with this exact string. For example, it will not ignore "bin / a.out".

The only thing I could think of was setting a global parameter that sets the glob syntax (as opposed to the default regex) hiding somewhere. I don’t know any such thing, and of course it is not enabled by default if you install the official binary version of Mercurial.

-3
source

If the .hgignore file is in your user profile directory (% userprofile% /. Hgignore), edit the mercurial.ini file (which should also be in the folder of your user profile):

 [ui] ignore = %USERPROFILE%/.hgignore 

This will make hg recognize and use your .hgignore file. The .hgignore file in your user profile directory will affect the hg behavior for all repositories. If you want to have specific settings for each repository, you will need to put the .hgignore files at the root of each repository.

+15
source
  • The .hgignore file must first be at the root of your repository
  • Then you should specify the syntax used in the first line of your .hgignore file (in your case, regexp):

syntax: regexp

0
source

All Articles