False negative repo detection: reports no git repo in directory with .git

Resolved 💬 1 comment Opened Mar 3, 2026 by llj0824 Closed Mar 3, 2026

Summary

Codex reported that there was no git repo in the working directory, but the directory does contain a valid .git folder and Git recognizes it as a work tree.

Git checks returned:

  • ls -la shows .git/
  • git rev-parse --is-inside-work-tree => true
  • git remote -v => empty (no remotes configured)

Despite that, Codex behavior/message indicated there wasn't even a git repo.

Expected

If .git exists and git rev-parse --is-inside-work-tree is true, Codex should recognize it as a git repo (even when no remote is configured).

Actual

Codex treated the directory as non-repo, which caused confusion and blocked expected git-flow guidance.

Environment

  • Date observed: 2026-03-03
  • OS: macOS 14.5 (arm64)
  • Codex CLI: codex-cli 0.107.0

Notes

This may be a path/context mismatch issue between user-visible cwd and the path used for repo detection.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗