branch exists 🌿 Git

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

  1. git switch x
  2. Recreate deliberately: git switch -C x (resets it)

Detailed fix by platform

Git

  1. git switch feature/login

How to diagnose

  1. Branches — git branch --list x
  2. 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.