平时都是用git checkout 分支名


但是这次报错了



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

然后执行命令


git fetch就好了

git fetch            →→ 这将更新git remote 中所有的远程repo 所包含分支的最新commit-id, 将其记录到.git/FETCH_HEAD文件中


然后再执行git checkout 分支名

提示:

 git checkout 8.7.16
Switched to a new branch '8.7.16'
Branch '8.7.16' set up to track remote branch '8.7.16' from 'origin'.

就成功切换远程分支了




Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐