zoukankan      html  css  js  c++  java
  • Git checkout别人的分支error

    在dev分支执行切换分支命令,失败。之前没有切到过这个分支。

    原因是,别人在远端新建的分支,需要fetch拉取同步远端所有的分支才可以。(虽然我本地dev分支有fetch->merge,但这两个操作应该不一样。 // 如有理解错误,请评论指出,谢谢!)

    PS E:codedevelopproject> git checkout other-branchB
    error: pathspec 'other-branchB' did not match any file(s) known to git

    解决办法:

    1)在dev分支:git branch -a  //查看所有分支列表,看到打印出

    other-branchA // 以前切换成功的分支,也是别人的分支
    * dev   // 当前分支
    remotes/origin/other-branchB// 远端分支

    2)git fetch // 拉取所有远端分支,看到打印出

     * [new branch]      other-branchB         -> origin/other-branchB

    3)  git checkout other-branchB //开始切换分支,看到下面的就是切换成功了

    Switched to a new branch 'other-branchB'
    Branch 'other-branchB' set up to track remote branch 'other-branchB' from 'origin'.

  • 相关阅读:
    Linux基本命令
    IDEA实用插件
    Windows常用快捷键
    IDEA常用快捷键
    OOP三大特性之多态
    IDEA里配置SSM框架,配置没问题却报404错误
    Tomcat的80端口被占用问题_解决方案
    基于SpringBoot开发
    java数据结构--线性表
    代码优化设计(一)
  • 原文地址:https://www.cnblogs.com/xxiaonian/p/14610843.html
Copyright © 2011-2022 走看看