Skipping the git repository check in Codex allows commands to run in temporary directories or non-versioned projects without creating a repository first.

The --skip-git-repo-check flag disables the guard that normally requires a repository root before execution. The flag applies only to the current command invocation and does not change global configuration.

Running outside a repository removes version-control context such as diffs, history, and branch state. For work that needs review or rollback, initializing a repository or running from inside an existing working tree keeps the usual safeguards.

Steps to skip Codex git repository checks:

  1. Create a scratch directory for non-repo runs.
    $ mkdir -p /tmp/codex-scratch
  2. Change to the directory that should run without git context.
    $ cd /tmp/codex-scratch
    $ pwd
    /tmp/codex-scratch
  3. Confirm the current directory is not a git working tree.
    $ git rev-parse --is-inside-work-tree
    fatal: not a git repository (or any of the parent directories): .git

    The fatal message indicates the repository guard would trigger in this directory.

  4. Run Codex with --skip-git-repo-check to bypass the repository guard.
    $ codex exec --skip-git-repo-check "Return OK."
    OK.

    Changes produced outside git are not tracked automatically, which can make review and rollback harder.