Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mercurial in Windows doesn't see .hgignore - why?

Windows fails to pick up my .hgignore file. I'm running Mercurial from the command line, and "hg status" shows lots of files in the ignored directories.

The .hgignore file looks like this (there's no whitespace at the start of the file, or at the start of each line). I've 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've tried saving the file in ANSI and UTF-8, and it doesn't seem to make a difference.

I know the file is working OK on Linux, is there anything different about the paths in Windows?

like image 598
AP257 Avatar asked Dec 13 '22 01:12

AP257


1 Answers

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

[ui]
ignore = %USERPROFILE%/.hgignore

That will cause hg to recognize and use your .hgignore file. The .hgignore file in your user profile directory will affect hg's behavior for all repositories. If you want to have specific per-repository settings, you should be able to put .hgignore files in the root of each repository.

like image 113
Samuel Meacham Avatar answered Dec 22 '22 15:12

Samuel Meacham