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

bogus config file vs. 'git config --edit'

From
SZEDER Gábor <szeder.dev@gmail.com>
Date
Dec 27, 2019, 11:04 UTC
Message-ID
<20191227110431.GC32750@szeder.dev>
Let's suppose I somehow ended up with a bogus config file:
  $ tail -n2 .git/config 
  [section]
          foo bar baz

and now I try to rectify the situation, but I know that poking around in the .git directory is a no-no, so instead of 'vim .git/config' I try:

  $ git config --edit
  fatal: bad config line 81 in file .git/config
Uh-oh.

Furthermore, if I don't remember quite clearly the finer points of the syntax of the config file, then I might want to look it up:

  $ git help config
  fatal: bad config line 81 in file .git/config

I think bith 'git config --edit' and 'git help ...' should just work, no matter what nonsense might be in the config file, even if they then launch a different editor or pager than what are set in the configuration.

Next: Jeff King
Message 1 of 2 in “bogus config file vs. 'git config --edit'”
  1. SZEDER GáborDec 27, 2019
  2. Jeff KingJan 8, 2020

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.