亲测可用
解决思路来自地址:这里
If the problem is with the index as the staging area for commits (i.e. .git/index), you can simply remove the index (make a backup copy if you want), and then restore index to version in the last commit:
On OSX/Linux/Windows(With Git bash):
rm -f .git/index
git reset
On Windows (with CMD and not git bash):
del .git\index
git reset
(The reset command above is the same as git reset --mixed HEAD)
You can alternatively use lower level plumbing git read-tree instead of git reset.
本文提供了解决Git staging area出现问题的解决方案,通过删除并恢复index到上一版本,针对不同操作系统给出了详细命令。适合遇到index问题的开发者参考。
520

被折叠的 条评论
为什么被折叠?



