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

remote url format in config

From
JTJohn te Bokkel / Tempus <tanj.tanj@gmail.com>
Date
Jul 30, 2009, 00:52 UTC
Message-ID
<47ade73f0907291752k62c66903lc2617a16ec0973bd@mail.gmail.com>
In-Reply-To
<47ade73f0907291750v281f3858qd3658c459dd950e8@mail.gmail.com>

There is a bug in the way the url is stored for remote urls. It is really a minor problem and easily worked around. However it may a good idea for the future to url encode that string.

What happened:
added a remote with two consecutive spaces in the url.

git remote add local_remote /dir/folder with\ \ -\ \ two consecutive\ \ spaces/project.git

git push local_remote master
error: url with only single spaces is not a git repo

the .git/config url is written correctly however it gets munged when it is read from the config.

 url = /dir/folder with  -  two consecutive  spaces/project.git
to make it work correctly, just quote it.
 url = "/dir/folder with  -  two consecutive  spaces/project.git"

perhaps it would be a good idea to url encode the url when it is first written to the config file.

 url = /dir/folder%20with%20%20-%20%20two%20consecutive%20%20spaces/project.git
Next: Björn Steinbrink
Message 1 of 2 in “remote url format in config”
  1. John te Bokkel / TempusJul 30, 2009
  2. config: Keep inner whitespace verbatimBjörn Steinbrink, Jul 30, 2009

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.