今天在项目里,添加了一个.png文件,后来发现没用,又给手动删除了。但是在commit的时候却还有这个文件,标注是A,也就是新增加的。discard changes也不管用。
提示:This operation cannot be undone
后来在命令行里,进入工程目录。然后git commit -a -m "commit error file"。希望通过命令强制commit。但是结果是:nothing to commit (working directory clean)。
最后直接在项目里随便做几个改动,再git commit -a -m "commit error file",就ok了。
不知道为什么会这样!