首页 > 其他分享 >git 拉取新分支 error: pathspec ‘develop‘ did not match any file(s) known to git

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

时间:2023-01-05 12:13:31浏览次数:42  
标签:git develop did linux ubuntu checkout 分支

 

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
[email protected]: 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   

 

 

 

 

 

 

 


 

标签:git,develop,did,linux,ubuntu,checkout,分支
From: https://www.cnblogs.com/dream397/p/17027151.html

相关文章

  • git stash保存和恢复进度
    gitstash保存和恢复进度一、应用场景当正在dev分支上开发某个项目,这时项目中出现一个bug,需要紧急修复,但是正在开发的内容只是完成一半,还不想提交,这时可以用gitstash命......
  • git提交代码到分支
    1、查询当前所在分支gitbranch-a2、保存当前工作进度,会把暂存区和工作区的改动保存起来。执行完这个命令后,在运行gitstatus命令,就会发现当前是一个干净的工作区,没有......
  • git dash 密码输错了,一直报错500 怎么办
    使用gitBashHere绑定账号密码错误后无法自动重新绑定Abraham_Kevin于2018-08-1716:15:26发布1122收藏分类专栏:git文章标签:git版权git专栏收录该内容2篇文......
  • Git
    什么是版本控制?版本控制是一种记录一个或若干文件内容变化,以便将来查阅特定版本修订情况的系统。你可以把一个版本控制系统( VersionControlSystem  缩写VCS)理解......
  • git commit 详解
    gitcommit命令用来将本地暂存的修改提交到版本库。gitcommit-m'提交信息'。我们用的比较多的应该就是-m参数。添加提交信息。经常手抖的同学可能会知道,gitcommit......
  • git 查看/修改用户名、密码
    git查看/修改用户名、密码虎鲸2019年06月03日13:55 ·  阅读4652用户名和邮箱地址的作用:用户名和邮箱地址是本地git客户端的一个变量,不随git库而改变。每......
  • Git - 子模块
    工作中会遇到这样的问题,当你在一个项目上时,你需要在其中使用另外一个项目,这个项目也许是一个第三方开发的库或者是你独立开发 合并在多个项目中使用的。这样就会产生一个......
  • git子模块的使用
    1.在项目中添加子模块命令: gitsubmoduleadd<url>例子: gitsubmoduleaddhttps://github.com/chaconinc/DbConnector此命令在当前工作目录添加了一个名为"DbConne......
  • HelloGitHub 最受欢迎的开源项目 Top10(2022年)
    再见2022,你好2023!HelloGitHub也随着2023年的到来,更新到了第81期开始迈向第7个年头啦。在过去的2022年,我们一共发布了12期月刊、分享了502个开源项目,Hel......
  • GIT多场景下使用
    git对于大家应该都不太陌生,熟练使用git已经成为程序员的一项基本技能,尽管在工作中有诸如 Sourcetree这样牛X的客户端工具,使得合并代码变的很方便。但找工作面试和一些需彰......