Storage location for global .gitconfig

Where is the global .gitconfig stored for each OS?

Linux: ~/.gitconfig

Mac: ~/.gitconfig

Windows: ????

2 answers

1 accepted

3 votes
Accepted answer
Jeff Thomas Atlassian Team Nov 20, 2013

Windows will store it in $HOMEDRIVE$HOMEPATH\.gitconfig

Which, depending on how things are mapped will likely be your %USERPROFILE%, or C:\Users\MyLogin\.gitconfig on Windows 7.

You can check where Git has it located by using the command below, it will open up the file in your default editor.

git config --global --edit

Thanks. Just for completeness: The command-line is the button named `Terminal`. In the windows console its %homedrive%%homepath%.

When executing that I get the following error "error: cannot spawn gitpad: no such file or directory. error: unable to start editor 'gitpad'

Turns out I needed to update the global core.editor (http://stackoverflow.com/a/773973/1366033) using `git config core.editor notepad`

0 votes
Jeff Thomas Atlassian Team Nov 19, 2013

Windows will store it in %USERPROFILE%\.gitignore

You can check where Git is set to look for the global ignore file with:

git config --get core.excludesfile

You can also set the global ignore with:

git config --global core.excludesfile "%USERPROFILE%\.gitignore"

I don't mean .gitignore but .gitconfig where things like core.autocrlf and similar are stored.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Dec 07, 2018 in Off-topic

Friday Fun: Dry T-Shirt Competition - What's your BEST (Atlassian) T-Shirt!?

[Note: So it was my turn for Friday Fun and sadly I was sick thanks to rubbish sinus infection... so apologies to most of Europe and Asia for the delayed post. However, I finally got out of bed for t...

385 views 27 5
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you