[Solved ] “error: pathspec ‘branch-name’ did not match any file(s) known to git” while doing git checkout branch-name

You need to do

git fetch --all

and this will pull down all the branches from origin. Then you can checkout your branch from upstream. (ie. on origin, in the cloud)

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store