Create
cancel
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

When using System git, my git config --global file is still SourceTree's?

I'm using SourceTree and Git 2.21.0 for Windows and was having a lot of trouble with configuration. SourceTree is set to use the system git install and shows the proper 2.21.0 version number. I ran these commands in a non-repository directory in command prompt and got surprising results:

- `git config --list` outputs mostly my `%ProgramData%\Git\Config` file's contents.

- `git config --global --list` output conflicting configuration data

- `git config --global --edit` opened `C:\Users\Me\.gitconfig`. I thought this was just the SourceTree global, I expected it to open the one in ProgramData.

- `git config --system --edit` opened `C:\Program Files\Git\mingw64\etc\gitconfig` as expected

- From the `%ProgramData%\Git\` directory, `git config --edit` produced an error.  

> fatal: not in a git directory

 

How is `git config` able to list my `%ProgramData%\Git\Config` contents but not edit that file and what is it if it isn't System, Global, or Local config?  Why is `git config --global` using the SourceTree file, is that just the default path to the Global config for git on Windows?

1 answer

1 accepted

0 votes
Answer accepted

Git for Windows has a 4th configuration file that cannot currently (v2.21.0) be edited from command line that is stored as `C:\Program Data\Git\config`. They are loaded before even System and so have the lowest priority.

Using `git config --list --show-origin` will show you where each configuration comes from.

Somehow, I got it in my head that this was the location of the global config file in windows when it is actually still `C:\Users\<UserName>\.gitconfig` which is the same file used by SourceTree's embedded git if you use that.

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,999 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