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
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 vote
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
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Brian Keough
Published 13m ago in Training & Certification

Project Administration in Jira Server is here!

The Atlassian Certification you've been waiting for is here for good. We're thrilled to announce the official launch of our new Certification for Project Administration in Jira Server! The offering ...

7 views 0 2
Read article

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