gitclone出现提示:warning:remoteHEADreferstononexistentref,unabletocheckout.
(2018-08-06 18:25:05)分类: 服务器 |
问题描述:
采用的是Git管理代码,从github上克隆代码:
git clone 我的项目名
提示:warning: remote HEAD refers to nonexistent ref, unable to checkout.
并且只显示.git文件
解决方法:
原因是.git目录下.git/refs/heads不存在HEAD指向的文件,这个时候可以用git
show-ref命令查看
获得如下打印:
f73460e266dec525ca2f9480
......类似
继续执行命令:
git branch
git branch
-a //输出
git
checkout
这样通过ll命令查看,代码下载到工作目录了
接着创建分支:git checkout
-b
git branch //可以看到输出*remotes/origin/dev了,不再为空
git branch
-m
git show-ref命令查看也能看到head了
至此,代码都显示出来,问题得到解决