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?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Since the git sources are maintained in git, we can find the revision that introduced the
--localoption: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--localoption 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).