报错原因 本人在本地开发中,切换线上新创建分支时: $ git checkout master01 error: pathspec 'master01' did not match any file(s) known to git 解决方式 $ git branch -a | grep master * masterremotes/origin/HEAD -> origin/masterremotes/origin/masterremotes/origin/master001 发现没有最新的分支,重新拉取 git fetch