1

I'm trying to load a config file in git, but the file is not in one of the default storage locations. I tried doing git config --file .gitconfig (when I was in the correct directory that contains the .gitconfig file) but git responded by giving me a standard help message. i.e.:

usage: git config [options]

Config file location
    --global              use global config file
    --system              use system config file
    --local               use repository config file
    -f, --file <file>     use given config file

etc.
2
  • Have you tried ./.gitconfig ?
    – Hastur
    Jun 21, 2015 at 19:20
  • No - I can't imagine why that would work, but I suppose I can try it
    – user291415
    Jun 21, 2015 at 19:22

2 Answers 2

1

Probably you want to do:

$ git config --local include.path "$PWD/.gitconfig"

This will include the local .gitconfig file.

0

If you want to use that as your global config file, copy it to your home directory:

cp .gitconfig ~/

It looks like setting the file for git config command is for the case when you want to --get a particular setting.

You must log in to answer this question.