|--question
git clone 下載一個倉庫出現一個警告,沒有生成相關的代碼
warning: 遠程 HEAD 指向一個不存在的引用,無法檢出。
warning: remote HEAD refers to nonexistent ref, unable to checkout.
|--solution
.git目錄下.git/refs/heads不存在HEAD指向的文件
git branch -a
git checkout remotes/origin/Zoro
此時,工程目錄下有相關代碼
git branch
提示
(頭指針分離於 origin/Zoro)
git checkout -b remotes/origin/Zoro
切換到一個新分支 'remotes/origin/Zoro'
* remotes/origin/Zoro
此時, 生成head
git branch -m remotes/origin/Zoro master
* master 切換到master分支
git branch -a
* master
remotes/origin/Zoro
attention:git help branch(指令名) 查看幫助