fatal: a branch named 'x' already exists
You tried to create a branch whose name is already taken locally.
Seen on:
Git
Meaning
Switch to it instead, or force-reset it if you really want to recreate it.
Common causes
- Branch created earlier
- Re-running scripts
⚡ Quick fix
- git switch x
- Recreate deliberately: git switch -C x (resets it)
Detailed fix by platform
Git
git switch feature/login
How to diagnose
- Branches — git branch --list x
- 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