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

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

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
Sep 27, 2012, 20:51 UTC
Message-ID
<vpqzk4bfaua.fsf@grenoble-inp.fr>
In-Reply-To
<20120927173532.GD1547@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 8 quoted lines
> 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).

I also strongly prefer symlinks or include over environment variables. Relying on environment variables makes the setup a bit fragile, partly because I often mess things up with my shell (e.g. I once had different shell and environment variables in ~/.xsession and in actual shells, hence different configuration depending on whether I launch stuff from my window-manager or from a shell).

I could understand using environment variables for one-shot configuration change (e.g. HOME=/tmp/ git whatever), but then $HOME is sufficient in general.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Previous: Junio C HamanoNext: Ramkumar Ramachandra
Message 10 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.