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

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

From
René Scharfe <l.s.r@web.de>
Date
Oct 2, 2017, 14:06 UTC
Message-ID
<dd28de03-9286-d5aa-3f00-9f6b7a85d71b@web.de>
In-Reply-To
<20171002061303.Horde.SL92grZCqTRV9oQkBFPELQ7@crashcourse.ca>
[When I try to reply to rpjday@crashcourse.ca then my SMTP server
 says "Requested action not taken: mailbox unavailable
 invalid DNS MX or A/AAAA resource record.", so I'm replying only
 to the list.]
Am 02.10.2017 um 12:13 schrieb rpjday@crashcourse.ca:
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?

"bla" represents any configuration option that you want to change. It is not literally a keyword recognized by git config. You could replace it with "foo", if that helps.

The comment in parentheses reminds readers that shells like bash do tilde expansion for command line arguments. Consider the following command:

	$ git config format.outputDirectory ~/patches

Your shell rewrites "~/patches" to "/home/rpjday/patches" (or similar, depending on your user name and home directory) before actually executing git config. So even though git config doesn't expand ~ in option values you'll still get a result like this afterwards:

	$ git config format.outputDirectory
	/home/rpjday/patches
René
Previous: rpjday@crashcourse.caNext: Jonathan Nieder
Message 2 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.