强制清除缓存

6

请问在终端中强制删除GIT缓存的命令是什么?

根据我所知,要删除GIT缓存可以使用以下命令:

git rm --cached 文件名

但现在我遇到了一个错误:

error: 'tutorial.h' has staged content different from both the file and the HEAD (use -f to force removal)

那么,请问我该如何将其删除?


是的,我想知道完整的指令是什么。 - Whatever Kitchen
1个回答

20
git rm --cached -f thefilename

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接