git clone时,提示warning: remote HEAD refers to nonexistent ref, unable to checkout.
来源:互联网 发布:卖家怎样开通淘宝达人 编辑:程序博客网 时间:2024/06/05 11:53
问题描述:
采用的是Git管理代码,从github上克隆代码:
git clone 我的项目名
提示:warning: remote HEAD refers to nonexistent ref, unable to checkout.
并且只显示.git文件
解决方法:
原因是.git目录下.git/refs/heads不存在HEAD指向的文件,这个时候可以用git show-ref命令查看
获得如下打印:
f73460e266dec525ca2f9480d3b2d254ce9a1325 refs/remotes/origin/dev
......类似
继续执行命令:
git branch //输入出空
git branch -a //输出 remotes/origin/dev
git checkout remotes/origin/dev // checkout的是git branch -a输出的内容
这样通过ll命令查看,代码下载到工作目录了
接着创建分支:git checkout -b remotes/origin/dev
git branch //可以看到输出*remotes/origin/dev了,不再为空
git branch -m remotes/origin/dev master //重命名分支叫master
git show-ref命令查看也能看到head了
至此,代码都显示出来,问题得到解决。
阅读全文
1 0
- 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'解决方法
- 整数排序(2)
- IntelliJ IDEA2017结合maven和nexus创建web项目
- Android 7.0后SettingProvider ContactsProvider TelephonyProvider MediaProvider数据库位置
- mql安装
- Linux kernel模块内核签名问题解决方法
- git clone时,提示warning: remote HEAD refers to nonexistent ref, unable to checkout.
- 笔记:接着前面的来,清空listview,刷新音乐列表
- [bigdata-088] go+ubuntu 一个最简单的api返回json格式数据的web app
- IPC之---管道
- 欢迎使用CSDN-markdown编辑器
- 【算法】程序猿不写代码是不对的65
- java 校验文件头 判断虚假文件
- CSU--------2133: 中南大学2017年ACM暑期集训前期训练题集(基础题)
- python013 -- 常用标准库