Codex Desktop creates .git directories in non-repository workspace folders, breaking Windows Git overlay icons

Resolved 💬 1 comment Opened Jul 12, 2026 by terryyan2024 Closed Jul 14, 2026

What version of the Codex App are you using (From “About Codex” dialog)?

26.707.31428

What subscription do you have?

ChatGPT Pro X20

What platform is your computer?

windows and mac

What issue are you seeing?

Environment:

  • Windows 11 / Windows 10.0.26200
  • Codex desktop app: OpenAI.Codex_26.707.3748.0_x64
  • Codex CLI: 0.142.3
  • Git: 2.53.0.windows.2
  • Explorer Git overlay provider: TortoiseGit

Problem:
Codex Desktop may create .git directories in the selected workspace folder or subfolders even when the selected workspace is not intended to be a Git repository root.

Our workspace layout is category-based, for example:

D:\WorkspaceRoot\
ProjectA\
ProjectB\
ProjectC\

Each project has its own repository boundary or may be managed separately. D:\WorkspaceRoot itself is not always intended to be treated as a Git repository root.

Observed behavior:

  • Codex creates .git directories under workspace/category folders.
  • Some of these .git directories are empty, but Explorer/TortoiseGit still treats them as Git roots.
  • This breaks Git overlay icons for the real project folders.
  • Removing the extra .git directory restores expected overlay behavior, but Codex may recreate it later.

Expected behavior:
Codex should not initialize or create .git directories automatically in a user-selected workspace unless the user explicitly requests Git initialization.

Suggested behavior:

  • Detect existing Git repositories without creating .git.
  • If no Git repo exists, run in non-Git workspace mode.
  • If Git initialization is needed, ask for confirmation first.
  • Provide a setting to disable automatic Git initialization entirely.

Impact:
This breaks Windows Explorer/TortoiseGit status overlays and makes unrelated project folders appear as part of the wrong Git repository.

What steps can reproduce the bug?

Codex Desktop may create .git directories in the selected workspace folder or subfolders even when the selected workspace is not intended to be a Git repository root.

What is the expected behavior?

_No response_

Additional information

_No response_

View original on GitHub ↗

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