New file automatically ignored

Hi all,

I'm not expert using Sourcetree, even though it's almost an year that I use it for basic operations. Lately I noticed that every time I add new files in my project, they're not added to the verioning system and it took a while for me to understand why. I eventually found out that they are ignored, even though they shouldn't be because they're not listed in the .hgignore file (not even as a content of an ignored directory).
So far the solution is to manually check if the file have been ignored and then add them, but as it easy to imagine, it's not the most confortable situation. I'm always worried to forget something and lose some files.

Can someone try to explain me what's happening?

3 answers

1 accepted

Hi Eugenio,

This may well be because you're looking at the wrong .hgignore. There's a global .hgignore file also. An easy way to look for all of your hgignore files is to call "locate .hgignore" at the terminal. You'll probably find one alled /Users/<username>/.hgignore_global. This may well have an ignore pattern in it which is causing those files to be ignored.


Does a syntax defined in .hgignore_global carry over to .hgignore files? The default for .hgignore files is regexp, but I notice in my .hg_ignore file that the syntax is defined as glob.

I assume that the syntax reverts when a new .hgignore file is encountered.

(I assume that some upgrade created the !/.hgignore_global file.)

1 vote
Timothy Chin Community Champion Oct 17, 2013

Can you confirm that your .hgignore does not have a regex that ignores files?

Timothy, thanks for your help, but that wasn't the case.
Kieran, you were right! I knew we had a global ignore file somewhere, but I always thought it was server-side. Editing it solved everything. Thanks!

Suggest an answer

Log in or Join to answer
Community showcase
Alexey Matveev
Published Saturday in Jira

How to run Jira in a docker container

Everything below is tested on Ubuntu 17.10. I prefer to use Jira in a docker container because: 1. I can install Jira with a couple of commands. 2. I can start and stop Jira just by starting and s...

130 views 3 5
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot