git切换分支时报错(error: pathspec ‘master‘ did not match any file(s) known to git.)的解决方法
git切换分支时报错切换分支:[root@git my_code]# git checkout master产生如下报错:error: pathspec 'master' did not match any file(s) known to git.解决方法:1、查看一下分支状况:[root@git my_code]# git branch -a2、若没有看到你想要的分支,先获取全部分支:[roo
·
git切换分支时报错
切换分支:
[root@git my_code]# git checkout master
产生如下报错:
error: pathspec 'master' did not match any file(s) known to git.
解决方法:
1、查看一下分支状况:
[root@git my_code]# git branch -a
2、若没有看到你想要的分支,先获取全部分支:
[root@git my_code]# git fetch
3、此时再查看一下分支情况
[root@git my_code]# git branch -a
可以看到我们想要的分支被显示出来了
4、切换分支
[root@git my_code]# git checkout master
[root@git my_code]# git branch --list
此时切换分支成功,问题解决
更多推荐
已为社区贡献1条内容
所有评论(0)