Reputation: 28158
I have created a .gitignore_global
file by running
git config --global core.excludesfile ~/.gitignore_global
However, I can't find the file in question in my file system? Where was it saved?
Upvotes: 22
Views: 13957
Reputation: 5619
touch ~/.gitignore_global
open .gitignore_global
add: .DS_Store
git config --global core.excludesfile ~/.gitignore_global
And you're done 🎉
Upvotes: 42
Reputation: 3202
You can find the file location by running this command in Terminal:
git config --get core.excludesfile
Upvotes: 13
Reputation: 66404
I have created a
.gitignore_global
file using the command [...]
The command
git config --global core.excludesfile ~/.gitignore_global
does not create any file. In other words, if ~/.gitignore_global
did not exist beforehand, running that command does not create it.
The semantics of that command are
Set the path of the user-level (because of the
--global
flag) Git ignore file to~/.gitignore_global
.
In terms of implementation, that command adds the following entry
excludesfile = ~/.gitignore_global
under the core
section of your ~/.gitconfig
file, which is the default path for the user-level config file. See this section of the Pro Git book for more details about the three levels (system, user, repository) of Git configuration files.
Upvotes: 24