Codex Desktop UI cannot initialize or detect existing Git repository (git init failed) while CLI works

Open 💬 1 comment Opened Feb 10, 2026 by maksymdonets

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

Version 260208.1016 (571)

What subscription do you have?

Plus

What issue are you seeing?

Codex Desktop UI cannot detect or initialize a Git repository in a workspace that is already a valid Git repository.

At the same time:

Git works correctly from terminal

Git works correctly from VS Code

Codex CLI can modify files, commit, and push successfully

However, the Codex Desktop UI:

Shows banner “Create a Git repository”

Fails with “Git init failed: Failed to run git init”

Does not show repository state or tracked files

<img width="342" height="90" alt="Image" src="https://github.com/user-attachments/assets/d1a81379-0806-4b19-a82b-09695bbfd4fd" />
<img width="374" height="348" alt="Image" src="https://github.com/user-attachments/assets/44ca6c76-ff60-4036-8d36-2a525fdea372" />

What steps can reproduce the bug?

  1. Install and open Codex Desktop (latest version).
  2. Add a local project that already contains a valid Git repository (.git exists).

Example path:
/Users/maksymdonets/work/projects/MarketPlace-e2e

  1. Open this project in Codex Desktop.
  2. Open the Git panel / right-side UI.
  3. Observe the banner “Create a Git repository”.
  4. Click “Create git repository”.

Result:
Codex Desktop UI fails with:
“Git init failed: Failed to run git init”.

Notes:

  • The same repository works correctly in terminal and VS Code.
  • Codex CLI can modify files, commit, and push successfully.
  • git rev-parse --is-inside-work-tree returns true.
  • git init succeeds when run from terminal.

What is the expected behavior?

Codex Desktop UI should correctly detect an existing Git repository
and display its current repository state (tracked files, changes, branch).

If the workspace already contains a valid .git directory:

  • Codex should not show “Create a Git repository”.
  • Git operations should not attempt to re-run git init.
  • Or, if Git access is restricted, the UI should clearly indicate

that Git metadata writes are blocked by permissions/sandboxing.

Additional information

This issue appears to be caused by Codex Desktop running Git operations
in a sandboxed environment that blocks write access to .git/* (e.g. .git/config,
.git/index.lock), even though normal file writes are allowed.

Observed internally:
Git operations from the Codex Desktop UI fail with “Operation not permitted”
when attempting to write to .git/config or create index.lock.

Workaround:
Using Git via terminal or VS Code works correctly.
Codex CLI can commit and push successfully.

Impact:
Codex Desktop Git UI is unusable for existing local repositories.

View original on GitHub ↗

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