** 錯(cuò)誤信息 **
錯(cuò)誤1
fetch failed
cannot lock ref 'refs/remotes/origin/feature/xxx': unable to create lock file .git/refs/remotes/origin/feature/xxx.lock; non-directory in the way
錯(cuò)誤2
Fetch failed: cannot lock ref 'refs/remotes/origin/Feature': there is a non-empty directory '.git/refs/remotes/origin/Feature' blocking reference 'refs/remotes/origin/Feature'
分析:
由于遠(yuǎn)程分支刪除,導(dǎo)致本地ref指向的remote 分支不存在,fetch不匹配,從而報(bào)錯(cuò)
解決方法:
// 回收
git gc --prune=now
//更新remote
git remote update --prune
//刪除報(bào)錯(cuò)的路徑
rm -rf .git/refs/remotes/