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

Re: [PATCH] config: introduce GIT_GLOBAL_CONFIG to override ~/.gitconfig

From
Jeff King <peff@peff.net>
Date
Sep 27, 2012, 17:35 UTC
Message-ID
<20120927173532.GD1547@sigill.intra.peff.net>
In-Reply-To
<1348757171-3223-1-git-send-email-artagnon@gmail.com>
On Thu, Sep 27, 2012 at 08:16:11PM +0530, Ramkumar Ramachandra wrote:
Show 11 quoted lines
> diff --git a/Documentation/git-config.txt b/Documentation/git-config.txt
> index eaea079..c8db03f 100644
> --- a/Documentation/git-config.txt
> +++ b/Documentation/git-config.txt
> @@ -205,6 +205,9 @@ $GIT_DIR/config::
>  	User-specific configuration file. Also called "global"
>  	configuration file.
>  
> +$GIT_GLOBAL_CONFIG::
> +	Overrides the path of the global configuration file.
> +

Like the other reviews, I am not overly enthused. If we are going to add a new variable, I think $GIT_HOME makes a lot more sense. But it really sounds like using $XDG_CONFIG_HOME would be even simpler.

Also, have you considered using a config include? Like:
  $ echo '[include]path = ~/my-dotfiles/gitconfig' >~/.gitconfig

It's a one-time setup, and then you get updates inside my-dotfiles forever. The one-time setup is annoying, but you have to bootstrap somehow (e.g., you're going to have to copy a .profile or similar to get the GIT_GLOBAL_CONFIG variable set).

-Peff
Previous: Junio C HamanoNext: Junio C Hamano
Message 8 of 14 in “Configuring the location of ~/.gitconfig”
  1. Ramkumar RamachandraSep 26, 2012
  2. David AguilarSep 26, 2012
  3. Ramkumar RamachandraSep 27, 2012
  4. config: introduce GIT_GLOBAL_CONFIG to override ~/.gitconfigRamkumar Ramachandra, Sep 27, 2012
  5. Matthieu MoySep 27, 2012
  6. Junio C HamanoSep 27, 2012
  7. Junio C HamanoSep 27, 2012
  8. Jeff KingSep 27, 2012
  9. Junio C HamanoSep 27, 2012
  10. Matthieu MoySep 27, 2012
  11. Ramkumar RamachandraSep 28, 2012
  12. Junio C HamanoSep 27, 2012
  13. Anurag PriyamSep 27, 2012
  14. Junio C HamanoSep 27, 2012

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.