git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Overriding ~/.gitconfig using GIT_CONFIG

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 12, 2011, 19:16 UTC
Message-ID
<7vr54qmodf.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1313163498.14274.505.camel@rex>
Richard Purdie <rpurdie@rpsys.net> writes:
Show 7 quoted lines
> Looking through the manuals/code, it suggests I should be able to do:
>
> GIT_CONFIG=/dev/null git XXX
>
> and all should work happily. It doesn't though. As an example, with a
> ~/.gitconfig, "GIT_CONFIG=/dev/null git fetch --all" is clearly
> accessing the file in ~ and then acting upon it.

If the manual says the above is expected for any value of XXX, then that is a bug in the manual since mid 2008, I think.

See dc87183 (Only use GIT_CONFIG in "git config", not other programs, 2008-06-30).

I _think_ these days a workaround to force a known config is to set HOME to a value that has a known .gitconfig (or no such file), and decline usage of /etc/git.config by exporting GIT_CONFIG_NOSYSTEM.

Previous: Richard PurdieNext: Junio C Hamano
Message 2 of 12 in “Overriding ~/.gitconfig using GIT_CONFIG”
  1. Richard PurdieAug 12, 2011
  2. Junio C HamanoAug 12, 2011
  3. Junio C HamanoAug 12, 2011
  4. Richard PurdieAug 12, 2011
  5. David AguilarAug 28, 2011
  6. Richard PurdieAug 29, 2011
  7. David AguilarAug 30, 2011
  8. Richard PurdieAug 30, 2011
  9. Jeff KingAug 30, 2011
  10. Richard PurdieAug 30, 2011
  11. Jeff KingAug 30, 2011
  12. Richard PurdieSep 5, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.