美文网首页Git相關
git push 错误处理

git push 错误处理

作者: 请你吃糖 | 来源:发表于2017-04-19 17:43 被阅读62次

** 错误信息 **
错误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

错误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'

分析:
由于远程分支删除,导致本地ref指向的remote 分支不存在,fetch不匹配,从而报错

解决方法:

// 回收
git gc --prune=now
//更新remote
git remote update  --prune
//删除报错的路径
rm -rf .git/refs/remotes/

相关文章

网友评论

    本文标题:git push 错误处理

    本文链接:https://www.haomeiwen.com/subject/orehzttx.html