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

后端 未结 30 3294
太阳男子
太阳男子 2020-11-27 23:54

I\'m not sure why I\'m unable to checkout a branch that I had worked on earlier. See the commands below (note: co is an alias for checkou

30条回答
  •  春和景丽
    2020-11-28 00:36

    In my case I have TWO branch 1) master(which is for live server) 2) dev(test server). I had set multiple remote to push code on respective server. When I tried to switch branch I got the error like error: pathspec 'master' did not match any file(s) known to git.

    You can see them by git remote -v. I had removed other remote except origin remote by git remote remove

    Then git fetch

    Now I am able to checkout branch by git checkout .

提交回复
热议问题