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.

5 answers

0 votes
minnsey Atlassian Team Mar 19, 2019

Hi

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)

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.

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 3.1.3.3158

Win10 Version 1809

I also have the same issue with same sourcetree version 

0 votes
DigiLive I'm New Here May 17, 2020

Same here...

Sourcetree 3.3.8

Windows 10 (1909 18363.778)

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.

Suggest an answer

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

Sourcetree for Windows - CVE-2019-11582 - Remote Code Execution vulnerability

A vulnerability has been published today in regards to Sourcetree for Windows.  The goal of this article is to give you a summary of information we have gathered from Atlassian Community as a st...

4,962 views 0 12
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