git clone时,提示warning: remote HEAD refers to nonexistent ref, unable to checkout.
来源:互联网 发布:tensorflow gpu下载 编辑:程序博客网 时间:2024/06/05 15:10
问题描述:
最近做Android开发,采用的是git管理代码,从git服务器上获取Contacts模块的代码:
git clone your-git-server
提示:warning: remote HEAD refers to nonexistent ref, unable to checkout.
并且Contacts模块的代码并没有下载到工作区。
解决方法:
原因是.git目录下.git/refs/heads不存在HEAD指向的文件,这个时候可以用git show-ref命令查看
获得如下打印:
5fa0b60252ca2c10fa3c2e12780d351c047c802d refs/remotes/origin/branch_qc_origin
5fa0b60252ca2c10fa3c2e12780d351c047c802d refs/tags/XXXXXXXXXXXX
48dee3a5f7b9cac98349e949275c652e02b0b67e refs/tags/PXXXXV0.0.0B01-bringup
505a9bb0c6d815e6db561f7cb7ed0e20cd73ddde refs/tags/PXXXX_02550_201309260427
e2b211a3c9d8dabec9fe1018b4f7db5c953832ea refs/tags/PXXXX_bsp_02550_201309260422
0848e8b7922c78dbb364aa0e7c1b8375d16a70a3 refs/tags/branch_PXXXX_02550_201309190102
7384803be7c8866393b96ebaaa7e1b2b119654e7 refs/tags/branch_PXXXX_02550_201309200102
480f444dd26bb238aeaacf15da748ad861ea9378 refs/tags/branch_PXXXX_02550_201309210102
......
可以看出,全部是标签tag,并没有类似refs/head/branch_name
继续执行命令:
git branch //输入出空
git branch -a //输出 remotes/origin/branch_qc_origin
git checkout remotes/origin/branch_qc_origin // checkout的是git branch -a输出的内容
这样通过ll命令查看,Contacts代码下载到工作目录了
接着创建分支:git checkout -b remotes/origin/branch_qc_origin
git branch //可以看到输出*remotes/origin/branch_qc_origin了,不再为空
git branch -m remotes/origin/branch_qc_origin master //重命名分支叫master
git show-ref命令查看也能看到head了
至此,问题得到解决。
- git clone时,提示warning: remote HEAD refers to nonexistent ref, unable to checkout.
- git clone时,提示warning: remote HEAD refers to nonexistent ref, unable to checkout.
- GitHub git clone时,提示warning: remote HEAD refers to nonexistent ref, unable to checkout.
- git clone问题: warning: remote HEAD refers to nonexistent ref, unable to checkout
- git clone warning: remote HEAD refers to nonexistent ref, unable to checkout
- warning: remote HEAD refers to nonexistent ref, unable to checkout.
- GIT warning: remote HEAD refers to nonexistent ref, unable to checkout.
- Error: Remote HEAD refers to nonexistent ref, unable to checkout
- warning: 远程 HEAD 指向一个不存在的引用,无法检出(warning: remote HEAD refers to nonexistent ref, unable to checkout)
- git clone: fatal: Unable to find remote helper for 'https'
- git clone时失败提示:Connection to bitbucket.org closed by remote host..00 KiB/s
- git clone templates not found / Unable to find remote helper for 'https' 错误
- 执行git clone提示“fatal: unable to access目标地址”的问题
- how to clone all remote branches in git
- remote: Permission to xxxxx/javaeelzw.git denied to xxxx. fatal: unable to access 'https://git
- Git出现fatal: Unable to find remote helper for 'https'
- git 错误 fatal: Unable to find remote helper for 'https'
- git 错误: Unable to find remote helper for 'https'解决方法
- MongoDB——第八天 驱动实践
- Crontab的格式
- C++黑窗口控制台中菱形的简单画法
- shell攻略-让文本飞
- Apache TrafficServer作为反向代理服务器
- git clone时,提示warning: remote HEAD refers to nonexistent ref, unable to checkout.
- uVA 10600 ACM Contest and Blackout (prim求次小生成树)
- 定时器实现 使用spring
- NS-2相关工具大体介绍<1>
- ios7 css 适配
- 哈希表及处理冲突的方法
- Servlet操作Cookie说明
- 观察者模式
- java实战(五)------tomcat 7.0的安装配置使用运行war包