我在取消跟踪文件时遇到了奇怪的问题。
我有一个已经被跟踪的文件index.css
。然后我将它添加到.gitignore
中。接着我运行以下命令,并得到如下输出:
$ git rm --cached build/development/css/index.css
rm 'build/development/css/index.css'
运行
git status
会得到以下结果:$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
deleted: build/development/css/index.css
尝试提交更改时,我收到以下错误消息:
Error:On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean
during executing git commit --only -F C:\Users\dtv\AppData\Local\Temp\git-commit-msg-7154374096157077481.txt -- build/development/css/index.css
如果我试图将对
index.css
的更改与其他更改一起提交,提交就会顺利进行,但是文件的更改仍然被检测到。我做错了什么?