当前位置: 代码迷 >> 综合 >> Git使用之(pathspec master did not match any file(s) known to git) 问题解决
  详细解决方案

Git使用之(pathspec master did not match any file(s) known to git) 问题解决

热度:89   发布时间:2023-09-29 10:54:07.0

Git使用之(pathspec master did not match any file(s) known to git) 问题

执行命令

git checkout master

报错如下:

error: pathspec 'master' did not match any file(s) known to git

解决办法

先看下分支

git branch -a 

查询结果

* developremotes/composer/developremotes/composer/feature/194remotes/composer/feature/198remotes/composer/feature/199remotes/composer/feature/200remotes/composer/masterremotes/origin/HEAD -> origin/developremotes/origin/developremotes/origin/feature/194remotes/origin/feature/198remotes/origin/feature/199remotes/origin/feature/200remotes/origin/master

这里会进入log,退出ctrl + c不管用,直接输入q即可(或者:q)

:q

如果没有看到你的分支,先获取所有分支

git fetch

然后再切换到你的分支即可

git check master
  相关解决方案