今个更新代码时候 平常屡试不爽的操作出了问题 重启git bash也没用
我输的是 git push origin test 即更新远程test分支成我本地的test
但是报了一个错:
error: remote unpack failed: error Missing blob 1527bc...巴拉巴拉的
网上搜了下,发现属于git本身bug,似乎和本地文件损坏有关
解决方法是依次执行命令:
1.git gc
2.git pull --rebase
3.git push origin test
但是在执行第二个命令时候又报错了:
error: cannot pull with rebase: You have unstaged changes.
error: please commit or stash them.
这时候需要先执行命令:
git stash
将所有未提交的修改(工作区和暂存区)保存至堆栈中
再执行:
2.git pull --rebase
3.git push origin test
问题解决
接
git rebase --abort