! [remote rejected] main -> main (branch is currently checked out)
You pushed to a non-bare repository whose working tree has that branch checked out.
Seen on:
Git
Meaning
Pushing into a repo with a working copy would desynchronise it. Remotes for pushing should be bare repos.
Common causes
- Remote created with git init instead of git init --bare
- Pushing to a deploy directory directly
⚡ Quick fix
- Recreate the remote as bare: git init --bare repo.git
- Or set receive.denyCurrentBranch updateInstead on the server repo
Detailed fix by platform
Git
git config receive.denyCurrentBranch updateInstead # on the server repo
How to diagnose
- Remote — Bare repository?
- Recent change — Did it start after a deploy, upgrade, or configuration change? Compare with the last working version.
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 2 Oct 2026