.hgignore not working for mercurial

designer-trying-coding picture designer-trying-coding · Feb 26, 2010 · Viewed 12k times · Source

I use mercurial for php projects and my .hgignore file is not working. It's supposed to be placed in the .hg/ folder, isn't it?

.hgignore

/.hg/.hgignore file

# Allow *. syntax
syntax:glob

# Ignore these files
.hgignore
.htaccess
.hg/*

Answer

VonC picture VonC · Feb 26, 2010

There is no mention in the .hgignore page of that file being inside .hg:

The .hgignore file sits in the working directory, next to the .hg folder.

And whatever file you want to ignore, you must be sure they are not already tracked. If they are, you need to remove them first, and then add them as private (non-tracked) file.