Git cannot checkout branch - error pathspec did not match any file s known to git

1.4K    Asked by BenjaminMoore in Python , Asked on Apr 16, 2021

 I'm unable to check out a branch in Git that I had worked on earlier. It is showing me the below message.

Git: cannot checkout branch - error: pathspec '…' did not match any file(s) known to git.
Answered by Ben PHILLIPS

While getting error “did not match any file s known to git”, You can try git fetch so that your local repository gets all the new info from github. It just takes the information about new branches and no actual code. After that, the git checkout should work fine.




Your Answer

Interviews

Parent Categories