[BUG] Desktop (macOS): app git sets GIT_CONFIG_NOSYSTEM when /etc/gitconfig is missing, dropping Apple's osxkeychain helper; Continue in Cloud push fails
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report
- [x] I am using the latest version of Claude Code
What's Wrong?
On macOS, the Desktop app's own git (Continue in > Claude Code on the Web, and the background refreshSourceRef fetch of origin/main) cannot authenticate to GitHub over HTTPS, while the same repo pushes and fetches fine from any shell on the same Mac.
Cause, traced in the app code (Desktop 2.16120.0, .vite/build/index.chunk-DiHnStOT.js, the "Desktop global config" builder used for the gated git spawns):
- The app runs
git config --system --list --show-origin -zto collect the system config. - On a Mac with no
/etc/gitconfig, that command exits 128 (fatal: unable to read config file '/etc/gitconfig'). This is the normal state of a Mac where git comes from Xcode or the Command Line Tools. - The app treats the failure as "system config unreadable", sets
noSystem, and spawns git withGIT_CONFIG_NOSYSTEM=1,GIT_TERMINAL_PROMPT=0andGIT_CONFIG_GLOBAL=<git-shadow>/<hash>-gitconfig(whose only content is[include] path = ~/.gitconfig). - Apple Git ships its credential helper in
<Xcode or CLT>/usr/share/git-core/gitconfig(credential.helper = osxkeychain). Git reports that file with scope "unknown", butGIT_CONFIG_NOSYSTEM=1suppresses it. Many Mac users have no helper anywhere else, so the app's git ends up with no credential helper and no way to prompt.
Two problems in that logic:
- A missing
/etc/gitconfigis not "unreadable";git config --system --listalso fails when the file simply does not exist. - Apple's toolchain gitconfig is not listed by
--system --listat all, so it can never be carried into the synthetic global config, yetGIT_CONFIG_NOSYSTEM=1still drops it.
What Should Happen?
The app's git should see the same credential helper the user's shell git sees. For example: treat a missing /etc/gitconfig as an empty system config (do not set GIT_CONFIG_NOSYSTEM), and/or carry Apple's usr/share/git-core/gitconfig (or at least its credential.helper) into the synthetic global config.
Error Messages/Logs
[error] Git command failed: git fetch --porcelain --verbose --no-write-fetch-head --no-prune --no-tags --no-prune-tags --refmap= origin +refs/heads/main:refs/remotes/origin/main { code: 128, stderr: "fatal: could not read Username for 'https://github.com': terminal prompts disabled\n" }
[info] [refreshSourceRef] single-ref fetch of origin/main failed (continuing with on-disk ref): fatal: could not read Username for 'https://github.com': terminal prompts disabled
[error] [TeleportToCloud] Transport push failed (auth)
Steps to Reproduce
On a Mac with Apple Git (Xcode or CLT), no /etc/gitconfig, no credential.helper in ~/.gitconfig, a GitHub login stored in the keychain, and a private repo with an HTTPS remote:
git config --show-origin --get-all credential.helpershowsosxkeychainonly from.../usr/share/git-core/gitconfig.git config --system --listexits 128.GIT_TERMINAL_PROMPT=0 git ls-remote originsucceeds.GIT_CONFIG_NOSYSTEM=1 GIT_TERMINAL_PROMPT=0 git ls-remote originfails with "could not read Username for 'https://github.com': terminal prompts disabled", which is exactly what the app hits.- In the Desktop app, open a local session on that repo and use Continue in > Claude Code on the Web: "Transport push failed (auth)".
Workaround: git config --global credential.helper osxkeychain (the synthetic config includes ~/.gitconfig). After that, the app's exact env and config authenticate.
Claude Model
Not sure / Multiple models
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
Claude Desktop 2.16120.0 (bundled Claude Code 2.1.284)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Other
Additional Information
The Desktop app's git is spawned through Claude.app/Contents/Helpers/disclaimer; that helper is not involved (it keeps HOME and PATH, and the keychain is reachable through it). Apple Git 2.54.0 (Apple Git-157), macOS 26.6.2.