| name | github-push-openssh |
| description | Fix GitHub push failures caused by SSH client mismatch in Codex Desktop on Windows, especially `git@github.com: Permission denied (publickey)` when `ssh -T git@github.com` works but `git push` fails. Use when pushing to GitHub from this repository and enforce repo-local Windows OpenSSH (`core.sshCommand`) instead of global changes. |
GitHub Push OpenSSH
Overview
Use this skill to diagnose and fix non-interactive Git push authentication failures in Codex Desktop by forcing Git to use Windows OpenSSH for this repository only.
Workflow
- Confirm the failure signature.
- Validate that direct Windows OpenSSH auth to GitHub works.
- Set repository-local
core.sshCommand to C:/Windows/System32/OpenSSH/ssh.exe.
- Verify with push dry-run.
- Run the real push.
Run scripts/push_with_windows_openssh.ps1 for this workflow.
Commands
Use from the repository root:
powershell -ExecutionPolicy Bypass -File .codex/skills/github-push-openssh/scripts/push_with_windows_openssh.ps1 -Branch "<branch-name>" -Remote origin
Dry-run only:
powershell -ExecutionPolicy Bypass -File .codex/skills/github-push-openssh/scripts/push_with_windows_openssh.ps1 -Branch "<branch-name>" -Remote origin -DryRunOnly
If -Branch is omitted, the script uses the current branch name.
Operating Rules
- Prefer repo-local config:
git config core.sshCommand "C:/Windows/System32/OpenSSH/ssh.exe"
- Avoid global config changes unless explicitly requested by the user.
- Do not change remote URLs unless explicitly requested.
- Do not expose private key contents.
Diagnostics Checklist
Run this sequence when troubleshooting:
git remote -v
ssh -T git@github.com
git config --show-origin --get core.sshCommand
git push --porcelain --dry-run -u origin HEAD:refs/heads/<branch-name>
If direct ssh -T succeeds but push fails with Permission denied (publickey), apply this fix:
git config core.sshCommand "C:/Windows/System32/OpenSSH/ssh.exe"
Then retry push dry-run and real push.
References
Read references/troubleshooting.md when:
- The push still fails after setting
core.sshCommand.
- You need deeper root-cause checks (
GIT_TRACE, ssh -vvv, client-path mismatch).