Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

SourceTree ignoring global .gitignore on Win10

I recently installed SourceTree on a new Win10 laptop and noticed SourceTree wasn't using my global .gitignore file.  I wasted a couple hours trying to get it working.  It looks like a bug under the options page.  The first item at the top of the page is "allow SourceTree to modify your global Git config files" and I verified that this was enabled but I noticed that when I changed the path for the "Global Ignore List" in the SourceTree options that my "c:\users\ssmith\.gitconfig" didn't have the updated excludesfile path.  It was still listed as "~/.gitignore".  After trying a bunch of different ideas, I finally unchecked the "allow SourceTree to modify your global Git config files" option, restarted SourceTree, then checked it again.  And then I set the path for the "Global Ignore List" in the SourceTreeoptions again.  After that, my global .gitignore started working.  Also, I noticed that the excludesfile path in my "c:\users\ssmith\.gitconfig" was now set to "C:\\Users\\ssmith\\.gitignore" instead of "~/.gitignore".  So in summary, it looks like SourceTree might not be correctly reading the "allow SourceTree to modify your global Git config files" option.  So unchecking it and checking it again might signal SourceTree that you really, really want to enable this option.

6 answers

I'm seeing exactly the same problem. SourceTree used to pick up the global .gitignore file but then ceased doing so a few months ago.

I've tried a number of versions of SourceTree and they all fail to pick up the global .gitignore file despite it showing correctly, and opening correctly, in the Tools -> Options -> Git dialogue. I know there are no issues with the file as it works correctly when using git from the command line.

I'm currently using SourceTree 3.3.9 on Windows 10 version 1903.

The only way I have found to overcome it is to copy the global .gitignore into my current repository each time.

Same here...

Sourcetree 3.3.8

Windows 10 (1909 18363.778)

I have the same issue, my global .gitignore is not being read by Sourcetree. 

My git does evaluate it as it should be, but Sourcetree does not.

I tried your workaround, but did not work for me.

I have sourcetree

Win10 Version 1809

I also have the same issue with same sourcetree version 

Still not working.  Version 3.4.7 of SourceTree.  Is Atlassian ever going to fix this?  The problem makes SourceTree useless to me, so my only option is to go to GitHub Desktop or some other provider.  When I right click on an unstaged file, the Ignore option is grayed out.

Same issue here. A colleague of mine has the exact same issue, while for me it works perfectly, we don't know why.

minnsey Atlassian Team Jun 09, 2019

Can you confirm the global ignore behaviour is working correctly from the command line for both of you?

I can, yes. If I use git on the command line, the gitignore is being evaluated as it should be.  I also noticed that his gitconfig-file is not being written with changes, e.g. if he changes the filename of his global gitignore-file... Don't know if those two issues are being related.

0 votes
minnsey Atlassian Team Mar 19, 2019


Thanks for raising this we will investigate further, but at this time I can't reproduce it in v3.1.1 (currently being rolled out)

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Sourcetree

Tip from the team: configure your repos for hosting goodness!

Supported Platforms macOS Windows We recently introduced support for additional hosting services such as GitHub Enterprise, GitLab (Cloud, Community Edition, Enterprise Edition), and...

7,154 views 5 13
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you