Common causes
- Trying to checkout a branch that doesn't exist locally — you need to fetch it first
- The branch name has a typo or uses the wrong case
- The remote branch exists but you haven't run git fetch yet
- Trying to checkout a file path that Git doesn't track
How to fix it
- Fetch all remote branches first: git fetch --all
- List available branches: git branch -a
- Checkout with the correct remote tracking name: git checkout -b <branch> origin/<branch>
- If the file doesn't exist yet, it can't be checked out — verify the path
Example
error: pathspec 'feature/login' did not match any file(s) known to gitRunning git checkout feature/login without fetching from remote first
Have a different error?
Paste any error message into the Error Translator to get an instant explanation.
