I believe this occurs when you are trying to checkout a remote branch that your local git repo is not aware of yet. Try:

git remote show origin

If the remote branch you want to checkout is under "New remote branches" and not "Tracked remote branches" then you need to fetch them first:

git remote update
git fetch

Now it should work:

git checkout -b local-name origin/remote-name

Git checkout on a remote branch does not work的更多相关文章

  1. 每天一命令 git checkout

    检出 checkout  是git常用命令之一.主要用于创建切换分支,覆盖本地修改等 git checkout 用于显示工作区,暂存区,版本库中文件的区别 git checkout -b branch ...

  2. git checkout not discard changes

    1. checkout one branch, show status user@vbox:/mnt/tmp$ git checkout masterSwitched to branch 'maste ...

  3. [Git]checkout 指定版本

    Task:知道commit号,如何checkout 指定版本 1. 切换到master: git checkout master 2. 下载最新代码:  git pull 3. 下载head: git ...

  4. git create remote branch (五)

    admin@PC-panzidong MINGW64 ~/WebstormProjects/backEndServer (master) 查看本地分支信息$ git branch* master ad ...

  5. git之remote branch controller(远程分支控制)

    1.创建本地分支 git branch  //查看远程分支 git checkout -b branch_name //创建远程分支 在查看分支git branch 2.将分支提交到远程仓库 此时远程 ...

  6. Git branch 和 Git checkout常见用法

    git branch 和 git checkout经常在一起使用,所以在此将它们合在一起 1.Git branch 一般用于分支的操作,比如创建分支,查看分支等等, 1.1 git branch 不带 ...

  7. git使用命令, 特别:git checkout -b a 与 git branch a区别

    摘自: https://my.oschina.net/u/587974/blog/74341 创建分支: $ git branch mybranch 切换分支: $ git checkout mybr ...

  8. 转 git使用命令, 特别:git checkout -b a 与 git branch a区别

    创建分支: $ git branch mybranch 切换分支: $ git checkout mybranch 创建并切换分支: $ git checkout -b mybranch 更新mast ...

  9. git入门(3)git checkout 和git branch分支的创建和删除

    在一个项目中,需要多人同时开发,协同coding 要求: 开发时请用开发分支daily/0.0.1, 禁止直接使用master分支开发新建分支 git checkout -b daily/0.0.1 ...

随机推荐

  1. 关于Linux上的SSH服务无法启动,提示“/var/empty/sshd must be owned by root and not group or world-writable”错误

    首先通过物理终端进入到linux上,手工检查ssh发现没运行# /etc/init.d/sshd statussshd is stopped 手动启动服务,发现报告权限错误.# /etc/init.d ...

  2. 简单几点让你快速了解python是什么

    1.python是什么 python是一种广泛使用的高级编程语言,属于通用型编程语言,由吉多·范罗苏姆创造,第一版发布于1991年.可以视之为一种改良(加入一些其他编程语言的优点,如面向对象)的LIS ...

  3. Python9-迭代器-生成器-day13

    迭代器# print('__iter__' in dir(int))# print('__iter__' in dir(list))# print('__iter__' in dir(dict))# ...

  4. cf950f Curfew

    神贪心--写了一个晚上加一个早上. 先考虑只有一个宿管的情况. 首先,如果这个宿舍人多了,多余的人就跑到下一个宿舍.(如果这是最后一个宿舍的话,多的就躺床底下) 如果这个宿舍人少了,但是能从别的宿舍调 ...

  5. c++ - 在终端中,cout不显示任何内容

    g++ 是一个编译器,它将源代码转换成可以执行程序,但不运行它. 你必须亲自运行程序. g++ 生成的程序的默认名称是 a.out ( 因为历史原因),因此你将运行它作为 $./a.out   如果要 ...

  6. centos 7安装libreoffice

    centos 7安装libreoffice Centos下的LibreOffice安装: 关键字: LibreOffice , sdk ,汉化  ,解压 安装Centos7之后,系统安装了libreo ...

  7. Charlie's Change(完全背包记录路径)

    Charlie is a driver of Advanced Cargo Movement, Ltd. Charlie drives a lot and so he often buys coffe ...

  8. 【UML】9种图+包图

    导读:在UML的学习中,介绍了9种图,外加一个包图.这9种图和4大关系,可以说是UML的一个核心内容.我根据自己的笔记,以及查阅的一些资料,对这9种图和包图,做一个总结. 一.基本定义 1.1  总体 ...

  9. 算法复习——splay+启发式合并(bzoj2733-永无乡)

    题目: Description 永无乡包含 n 座岛,编号从 1 到 n,每座岛都有自己的独一无二的重要度,按照重要度可 以将这 n 座岛排名,名次用 1 到 n 来表示.某些岛之间由巨大的桥连接,通 ...

  10. 【2018.4.5】Shoi2017题集

    这三道题分别对应bzoj4868~4870,pdf没法往这放,因此放弃了. T1: 方法1(正解):三分法 考虑暴力枚举最晚公布的时间x,关注到2操作是没有负面影响的1操作,所以如果A大于B,那么只需 ...