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

Re: ~/.git/config ?

From
Junio C Hamano <junkio@cox.net>
Date
May 27, 2006, 09:11 UTC
Message-ID
<7vejyfhlxg.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<Pine.LNX.4.64.0605262007230.5623@g5.osdl.org>
Linus Torvalds <torvalds@osdl.org> writes:
Show 7 quoted lines
> On Sat, 27 May 2006, Petr Baudis wrote:
>> 
>> ~/.gitrc might get useful for actually doing what ~/.cvsrc or ~/.cgrc
>> does, that is providing default options for git commands. ~/.gitconfig
>> would just give you per-user defaults for the repository config file.
>
> I don't think the two are necessarily any different.

Me neither. Default options to fall back on if repository configuration does not specify them and when environments do not override them -- that's exactly "per-user defaults", nothing else.

Earlier I suggested ~/.git-config, but anything other than ~/.git/config is OK. ~/.gitrc is fine. And the order suggested by Anand sounded fine.

 - use environment (if the value is obtained, stop here)
 - use .git/config (if the value is obtained, stop here)
 - use ~/.git-config (if the value is obtained, stop here)
 - do whatever the program does by default.
>  (a) we might as well use the same syntax. There's no point in having 
>      different syntax for the files, even if they end up having slightly 
>      different usage.
Absolutely.
>  (b) a "user-wide" config file would tend to have different things in it 
>      than a per-repository one, but some of the things it would have in it 
>      are the things that we currently put in the per-repository one. 
>      Notably exactly the "user.name" and "user.email" values.

Yes. Also "preference" kind of things as opposed to "per project policy" such as apply.whitespace.

Previous: Jakub NarebskiNext: Nikolai Weibull
Message 13 of 19 in “~/.git/config ?”
  1. Anand KumriaMay 26, 2006
  2. Timo HirvonenMay 26, 2006
  3. Jakub NarebskiMay 26, 2006
  4. Petr BaudisMay 26, 2006
  5. Timo HirvonenMay 26, 2006
  6. Petr BaudisMay 26, 2006
  7. Pavel RoskinMay 27, 2006
  8. Petr BaudisMay 27, 2006
  9. Linus TorvaldsMay 27, 2006
  10. Linus TorvaldsMay 27, 2006
  11. Junio C HamanoMay 27, 2006
  12. Jakub NarebskiMay 27, 2006
  13. Junio C HamanoMay 27, 2006
  14. Nikolai WeibullMay 27, 2006
  15. Timo HirvonenMay 27, 2006
  16. Junio C HamanoMay 26, 2006
  17. Read configuration also from ~/.gitrcPetr Baudis, May 28, 2006
  18. Johannes SchindelinMay 29, 2006
  19. Jakub NarebskiMay 29, 2006

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.