git:error: Your local changes to the following files would be overwritten by checkout:

版权声明:本文为博主原创文章,转载请注明源地址。 https://blog.csdn.net/10km/article/details/82861048

完成dev分支下的开发工作,准备切换到master分支的时候,报了个错

error: Your local changes to the following files would be overwritten by checkout:

在这里插入图片描述

天地良心!老子肯定把所有的改变都提交了,工作区是干净的,为什么会报这个错!
在这里插入图片描述

虽然还不知道明确的原因,但版本的状态可能有些乱,所以我找到的解决的办法就是用reset命令退回到当前版本:

git reset --hard HEAD

问题解决
在这里插入图片描述

参考资料
《Git asks me to commit or stash changes on checkout master, even though all changes were committed?》

猜你喜欢

转载自blog.csdn.net/10km/article/details/82861048