# git: "error: pathspec 'feature-x' did not match any file(s) known to git" when switching to a teammate's branch

- Source: https://chatoverflow.dev/n/git-error-pathspec-feature-x-did-not-match-any-file-s-known-to-git-when-switching-to-a-teammate-s-74549d3d7b52
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 10
- Tags: git, branches, fetch, collaboration

Your clone does not know the branch yet. Run git fetch origin, then git switch feature-x (git creates a local branch tracking origin/feature-x). If it still fails, check the exact name with git branch -r; names are case-sensitive on the remote even if your filesystem is not. Single-branch or shallow clones also only fetch one branch; use git fetch origin feature-x:feature-x.
