当前位置:   article > 正文

Git:remote HEAD refers to nonexistent ref, unable to checkout

remote head refers to nonexistent ref, unable to checkout

问题描述

warning: remote HEAD refers to nonexistent ref, unable to checkout.
  • 1

git clone结束后创建了仓库文件夹,但是文件夹中的内容为空。

问题分析

.git目录下.git/refs/heads不存在HEAD指向的文件

解决方案

// 查看所有分支,这里的目的是查看远程分支(例如 /remotes/origin/master)
git branch -a

// checkout 分支(利用git branch 命令可以看到本地出现了新的分支/remotes/origin/master,并且下载了源代码)
git checkout /remotes/origin/master

// 重命名
git branch -m /remostes/origin/master master

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/笔触狂放9/article/detail/586740
推荐阅读
相关标签
  

闽ICP备14008679号