Thread (1 message) 1 message, 1 author, 2016-06-15
  • (off-list ancestor, not in this archive)
  • Re: ~/.git/config ? · Junio C Hamano <hidden> · 2016-06-15

Re: ~/.git/config ?

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:27

Linus Torvalds [off-list ref] writes:
On Sat, 27 May 2006, Petr Baudis wrote:
quoted
~/.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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help