In what git version became the git config --local
option available, and where can I read more about it?
I thought that not providing --global
will automatically assume that it's a local config variable. Why was this new option necessary?
Since the git sources are maintained in git, we can find the revision that introduced the --local
option:
commit 57210a678a8bedd222bf4478eeb0a664d9dd5369
Author: Sverre Rabbelier <[email protected]>
Date: 2010-08-03 20:59:23 -0500
config: add --local option
This is a shorthand similar to --system but instead uses
the config file of the current repository.
It appears that this change first appeared in release 1.7.4 which came out in late 2010 or so.
As far as I can tell from a quick look at the source code (builtin/config.h
) and man page, the default is local unless certain environment variables are set, particularly $GIT_CONFIG
. The --local
option explicitly overrides any environment variable settings.
See VonC's answer for more information on the semantics of --local
(the documentation was updated after I originally posted this answer).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With