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

How to set global git config

How do you specify autocrlf = true for all repositories in SourceTree ?

SourceTree allows you to specify a git config for each repository, so you'd need to manually add autocrlf = true to each config file. Does SourceTree allow you to specify a global git config for all repositories ?




2 answers

As far as I know, you cannot do this with SourceTree directly - but as usual, git-commandline is your friend:

You've got three levels of .gitconfig - which are stored at different locations

  • local - i.e. within your single repository - stored within your .git-folder of your project
  • global - i.e. for all of YOUR repositories - stored somewhere like %USERPROFILE%
  • system - i.e for all repositories of all users on your system - on windows systems this is normally stored where your git installation resides

You set options within those three configuration files using a dedicated option:

git config --local/–global/–system ....


Hope that helps



Yeah, definitely recommend using git config --global, but if any of your repositories have autocrlf set to something else locally, that will take precedence over the global setting.

Like Ayinde Ayobami likes this

Seth is right: you have to consider that there is a precedence:  local overwrites global overwrites system

On Windows 7  (maybe same or similar for Windows 10) for Visual Studio and git command line, your global config is in


(dot is in front of the file)

but this is not honored by SourceTree at least in Git Embedded mode, and the config is in 


(no dot in front of the file)


[I needed to update both files to modify my global git settings for git command and SourceTree]


Here is more that I found about it because some settings are still overridden by some other 'global' config 

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