2

I would like to set git defaults for all users on my system.

Where can I find the global system-wide configuration?

There is no such file as

/etc/gitconfig

Thanks.

0

1 Answer 1

4

If you installed the git* package(s) from the default repositories, the system-wide Git configuration is supposed to reside in /etc/gitconfig (since $(prefix) is empty for those Git installations). See the following git-config(1) manual excerpt:

--system

  • For writing options: write to system-wide $(prefix)/etc/gitconfig rather than the repository .git/config.

  • For reading options: read only from system-wide $(prefix)/etc/gitconfig rather than from all available files.

    See also FILES.

[…]

FILES

If not set explicitly with --file, there are four files where git config will search for configuration options:

  • $(prefix)/etc/gitconfig

    System-wide configuration file.

[…]

If there is no such file, sudo git config --system <name> <value> will create it for you. Alternatively you can create it manually with your favourite text editor. This is the same behaviour as for global (~/.gitconfig) and local ($GIT_DIR/config) Git configuration files

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .