Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,556,392
Community Members
 
Community Events
184
Community Groups

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 ?

 

Thanks.

 

2 answers

2 votes
Johannes Kilian
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Oct 17, 2016

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 ....

See: https://git-scm.com/docs/git-config

Hope that helps

Cheers

Johannes

Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Oct 18, 2016

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
Johannes Kilian
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Oct 18, 2016

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

%USERPROFILE%\.gitconfig

(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 

%USERPROFILE%\AppData\Local\Atlassian\SourceTree\git_local\mingw32\etc\gitconfig

(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 https://stackoverflow.com/a/55839051/1818723 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events