Common causes
- You already created this branch previously
- You're trying to create a branch from a different starting point but the name is taken
- A teammate's branch was fetched and shows up as a remote tracking ref with the same name
- A script or automation created the branch before you ran the command
How to fix it
- Switch to the existing branch: git checkout <branch-name>
- List all branches to see what exists: git branch -a
- Delete the old branch if it's safe: git branch -d <branch-name>, then create a new one
- Use a different name: git checkout -b <new-unique-name>
Example
fatal: A branch named 'feature/login' already exists.Running git checkout -b feature/login when that branch was already created
Have a different error?
Paste any error message into the Error Translator to get an instant explanation.
