git clone下載代碼提示不存在HEAD指向的文件

|--question

  git clone 下載一個倉庫出現一個警告,沒有生成相關的代碼git

  warning: 遠程 HEAD 指向一個不存在的引用,沒法檢出。
  warning: remote HEAD refers to nonexistent ref, unable to checkout.spa

|--solution指針

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

    git branch -a 
    git checkout remotes/origin/Zoroit

  此時,工程目錄下有相關代碼
    git branch
    提示
  (頭指針分離於 origin/Zoro)io

  git checkout -b remotes/origin/Zoroast

  切換到一個新分支 'remotes/origin/Zoro'
* remotes/origin/Zoroclass

此時, 生成head下載

  git branch -m remotes/origin/Zoro master引用

  * master 切換到master分支

    git branch -a
  * master
    remotes/origin/Zoro
  attention:git help branch(指令名) 查看幫助

相關文章
相關標籤/搜索