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

Re: What means "git config bla ~/"?

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Oct 2, 2017, 17:13 UTC
Message-ID
<20171002171300.GP19555@aiede.mtv.corp.google.com>
In-Reply-To
<20171002061303.Horde.SL92grZCqTRV9oQkBFPELQ7@crashcourse.ca>
Hi,
rpjday@crashcourse.ca wrote:
Show 12 quoted lines
> i'm sure i'm about to embarrass myself but, in "man git-config",
> OPTIONS, one reads:
>
>   --path
>
> 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
or
	git config --global include.path $HOME/.config/git/more-config
to cause
	[include]
		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
	[include]
		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 directory.

The wording comes from
	commit 1349484e341a3ec2ba02a86c8fbd97ea9dc8c756
	Author: Matthieu Moy <Matthieu.Moy@imag.fr>
	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 clarifying it?

Thanks, Jonathan

Previous: René ScharfeNext: Junio C Hamano
Message 3 of 6 in “What means "git config bla ~/"?”
  1. rpjday@crashcourse.caOct 2, 2017
  2. René ScharfeOct 2, 2017
  3. Jonathan NiederOct 2, 2017
  4. Junio C HamanoOct 3, 2017
  5. Matthieu MoyOct 3, 2017
  6. Junio C HamanoOct 4, 2017

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.