views:

634

answers:

2

Hi friends,

I use mercurial for php projects at localhost. and my .hgignore is not working :/ we host it under .hg/ folder, dont we? I googled so much for the issue, my code is exactly same with other examples, but mine is not working :/


/.hg/.hgignore file

# Allow *. syntax
syntax:glob

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

Thanks a lot!

+2  A: 

Just from memory I think .hgignore needs to live in the repository root. You certainly don't need to tell it to ignore the .hg folder, that will happen more or less automatically. Any reason why you don't want your ignore and access settings in your repo?

Johannes Rudolph
memory? i restarted mamp and mercurial... still same problem :/ i'm editing .htaccess file and mercurial is just taking the changes :/ ps, sorry but i didnt understand your question
artmania
Johannes Rudolph is correct. The .hgignore should go in your repository root, not in your .hg directory. Any files you've already added override .hgignore. Files can't be both tracked and ignored, and if tracked it overrides the ignoring. He's also correct that .hg doesn't need to be in the .hgignore file -- that's automatic.
Ry4an
artmania: Mercurial stores these setting in .hgignore and .htacsess respectively. If you put them on the ignore list they won't be tracked by mercurial if they weren't added before.
Johannes Rudolph
@Ry4an: You're correct, feel free to edit my answer and add that important part.
Johannes Rudolph
Ry4an: thanks for cool info ! it helped a lot!
artmania
+5  A: 

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.

VonC
aha yes! i supposed to make "Remove From Repository" for the files defined in .hgignore! just did it, and now it is fine! working well :) thanks
artmania