Re: What means "git config bla ~/"?
- Date: Mon, 2 Oct 2017 10:13:00 -0700
- From: Jonathan Nieder <jrnieder@xxxxxxxxx>
- Subject: Re: What means "git config bla ~/"?
> i'm sure i'm about to embarrass myself but, in "man git-config",
> OPTIONS, one reads:
> git-config will expand leading ~ to the value of $HOME, and ~user
> to the home directory for the specified user. This option has no
> effect when setting the value (but you can use git config bla ~/
> from the command line to let your shell do the expansion).
> what's with that "git config bla ~/"? is this some config keyword
> or something?
No need to be embarrased. Here "bla" is a placeholder. That is,
for example, I can run
git config --global include.path ~/.config/git/more-config
git config --global include.path $HOME/.config/git/more-config
path = /home/me/.config/git/more-config
to be added to my global configuration. The expansion of ~ or $HOME
is performed by my shell, not Git. For comparison, if I had run
git config --global include.path '~/.config/git/more-config'
then that would cause
path = ~/.config/git/more-config
to be added to my global configuration, but it would still have the
same effect at run time, since Git is also able to expand ~ to my home
The wording comes from
Author: Matthieu Moy <Matthieu.Moy@xxxxxxx>
Date: Wed Dec 30 17:51:53 2009 +0100
builtin-config: add --path option doing ~ and ~user expansion.
I agree with you that it is less clear than it could be. Ideas for