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

bugreport: "git config --global" fails if an invalid .git file present

From
JJJinwook Jeong <vustthat@gmail.com>
Date
Aug 16, 2022, 16:16 UTC
Message-ID
<CAA3Q-aYfn0om2tXjwH-9ayaX57Yj6xkKw1hpi2asthgHvWovsw@mail.gmail.com>
What did you do before the bug happened? (Steps to reproduce your issue)

Executing `git config --global ...` and $PWD/.git exists as a file and is invalid.

What did you expect to happen? (Expected behavior)
Git reads from or writes to the global config store.
What happened instead? (Actual behavior)
It prints:
  fatal: invalid gitfile format: $PWD/.git
What's different between what you expected and what actually happened?

Git fails to access the global config even if the current directory's `.git` file has nothing to do with the global config.

[System Info] git version: git version 2.37.2 cpu: arm64 no commit associated with this build sizeof-long: 8 sizeof-size_t: 8 shell-path: /bin/sh feature: fsmonitor--daemon uname: Darwin 21.6.0 Darwin Kernel Version 21.6.0: Sat Jun 18 17:07:22 PDT 2022; root:xnu-8020.140.41~1/RELEASE_ARM64_T6000 arm64 compiler info: clang: 13.1.6 (clang-1316.0.21.2.5) libc info: no libc information available $SHELL (typically, interactive shell): /opt/homebrew/bin/bash

[Enabled Hooks] not run from a git repository - no hooks to show

Next: Jeff King
Message 1 of 4 in “bugreport: "git config --global" fails if an invalid .git file present”
  1. Jinwook JeongAug 16, 2022
  2. Jeff KingAug 18, 2022
  3. Junio C HamanoAug 18, 2022
  4. Jinwook JeongAug 24, 2022

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.