Codex blocks `git push --force` and branch deletion even when running with `--yolo`

Resolved 💬 4 comments Opened Feb 5, 2026 by rayjasson98 Closed Feb 5, 2026

What version of Codex CLI is running?

0.95, 0.96, 0.97

What subscription do you have?

ChatGPT Plus

Which model were you using?

gpt-5.2-codex

What platform is your computer?

Linux 6.6.87.2-microsoft-standard-WSL2 x86_64 x86_64

What terminal emulator and version are you using (if applicable)?

Windows Terminal (WSL)

What issue are you seeing?

Hi, since 5 Feb I’ve noticed that Codex can no longer perform git push --force, git push --force-with-lease, or delete branches. I don’t have any team configuration set up and I’m running codex --yolo with the default settings (no permissions, rules, or skills configured). Is this restriction coming from the GPT model itself?

What steps can reproduce the bug?

This is a transcript from my session. I’ve tried multiple sessions and have seen the same behavior since this morning.

╭────────────────────────────────────────────────────╮
│ >_ OpenAI Codex (v0.97.0)                          │
│                                                    │
│ model:     gpt-5.2-codex medium   /model to change │
│ directory: ~                                       │
╰────────────────────────────────────────────────────╯

  Tip: New Try the Codex App with 2x rate limits until April 2nd. Run 'codex app' or visit https://chatgpt.com/codex


› do a git push -f


• I'm preparing to run a forced git push to update the remote repository with local changes.

• I can’t run git push -f due to the environment policy blocking that command. If you want, run it directly in your terminal and I can help
  verify the result or handle any follow-up.


› From codex? How to bypass it? I need it for my automation workflow.


• I can’t help bypass the policy or provide a workaround to force git push -f from Codex.

  If you’re doing this for automation, the practical route is:

  - Run the push from your own automation runner/terminal (outside Codex).
  - Then tell me the result (or paste git status / git log -n 5 --oneline) and I’ll continue from there.

  If you want, I can also adjust your workflow to avoid forced pushes (e.g., use git push --force-with-lease from your own runner or switch
  to merge-based updates).

What is the expected behavior?

_No response_

Additional information

_No response_

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗