git push 报错 error: unpack failed: error Missing tree
报错信息如下
Your branch is ahead of ‘分支名’ by 8 commits.
(use “git push” to publish your local commits)
You are currently rebasing branch ‘分支名’ on ‘7838fda’.
(all conflicts fixed: run “git rebase --continue”)
nothing to commit, working tree clean
and the repository exists.
Enumerating objects: 248, done.
Counting objects: 100% (209/209), done.
Delta compression using up to 8 threads
Compressing objects: 100% (76/76), done.
Writing objects: 100% (146/146), 131.88 KiB | 3.38 MiB/s, done.
Total 146 (delta 75), reused 114 (delta 57)
remote: Resolving deltas: 100% (75/75)
error: remote unpack failed: error Missing tree bccf7a562ee43503e081e72c6b0feffdb740de85
To 项目地址
! [remote rejected] 分支名 ->分支名 (n/a (unpacker error))
error: failed to push some refs to
问题原因是本地索引出现问题
在网上是了很多种方法,有说 加 --no-thin,我试了一下没有效果。
后来,找到一篇博文从中找到了解决方法
https://segmentfault.com/q/1010000003036343
git gc -------------->压缩历史信息来节约磁盘和内存空间
git pull --rebase ------------------->合并代码
git push ---------->提交代码即可