git 拉取新分支 error: pathspec ‘develop‘ did not match any file(s) known to git

 

git上有develop分支,branch查看分支看不到develop,checkout切换分支报错

一、问题

 

git上有develop分支,branch查看分支看不到develop,checkout切换分支报错

(一)branch查看分支
git branch -a
结果:看不到develop分支。

(二)checkout切换分支
git checkout develop
结果:报错error: pathspec 'develop' did not match any file(s) known to git.

二、解决方案

先fetch更新分支再checkout切换分支(由于远程分支是新建的,本地没有更新)

(二)fetch更新远程分支
git fetch
(二)checkout切换分支-
git checkout develop

复制代码
root@ubuntu:/home/ubuntu/linux-tsn# git branch --all
* dev
  remotes/origin/dev
root@ubuntu:/home/ubuntu/linux-tsn# git checkout dev2.0
error: pathspec 'dev2.0' did not match any file(s) known to git.
root@ubuntu:/home/ubuntu/linux-tsn# git fetch
git@192.168.23.45: Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
root@ubuntu:/home/ubuntu/linux-tsn# ssh-add ~/Ssh.pub 
~/Ssh.pub: No such file or directory
root@ubuntu:/home/ubuntu/linux-tsn# ssh-add .~/Ssh.pub 
Error loading key ".~/Ssh.pub": invalid format
root@ubuntu:/home/ubuntu/linux-tsn# ssh-add .~/Ssh
Identity added: .~/Ssh (.~/Ssh)
root@ubuntu:/home/ubuntu/linux-tsn# git fetch
remote: Counting objects: 108491, done.
remote: Compressing objects: 100% (93832/93832), done.
Receiving objects:  95% (103480/108477), 975.51 MiB | 31.39 MiB/s   
复制代码

 

 

 

 

 

 

 


 

posted on   tycoon3  阅读(3450)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· ollama系列01:轻松3步本地部署deepseek,普通电脑可用
· 25岁的心里话
· 按钮权限的设计及实现
历史上的今天:
2021-01-05 Unikernel
2021-01-05 Unikernel初体验

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

点击右上角即可分享
微信分享提示