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

Re: git makes it impossible to ignore or override global gitconfig, needs `GITCONFIGFILE`

From
EWEric Wong <e@yhbt.net>
Date
Mar 19, 2020, 06:44 UTC
Message-ID
<20200319064407.GA26408@dcvr>
In-Reply-To
<CANri+Ey71QbWxNH+RhMfYuUSDEpYtv28ushUhK8Tt0xWUAU9iw@mail.gmail.com>
Timothee Cour <thelastmammoth@gmail.com> wrote:
Show 9 quoted lines
> git makes it impossible to ignore global gitconfig. This is
> essentially what's being asked here:
> https://stackoverflow.com/questions/23400449/how-to-make-git-temporarily-ignore-gitconfig
> 
> ## proposal:
> add an environment variable (like for tig and other programs), eg:
> `GITCONFIGFILE=~/.gitconfig_temp git diff`
> seems like an easy change that would make it easy for users to ignore
> or override their gitconfig

You can use GIT_CONFIG for that, and there's also GIT_CONFIG_NOSYSTEM. They're both documented in the git-config(5) manpage.

> ## note:
> I've asked here:
> https://groups.google.com/forum/#!topic/git-users/1ehWsItL8vE but got
> 0 response after 6 months

Oh well... I don't pay any attention to that list, and not too much to this one, either. I was just working on the archives and noticed this was the latest message on this list :>

Previous: Timothee CourNext: Jeff King
Message 2 of 5 in “git makes it impossible to ignore or override global gitconfig, needs `GITCONFIGFILE`”
  1. Timothee CourMar 19, 2020
  2. Eric WongMar 19, 2020
  3. Jeff KingMar 19, 2020
  4. Timothee CourMar 20, 2020
  5. Jeff KingMar 20, 2020

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.