我正在执行这个命令来删除第二个文件(第一个是JetBrains的 .idea 文件夹,现在已经在 .gitignore 中了),但我无法成功:
git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch gf5/console/basic.php' --prune-empty --tag-name-filter cat -- --all
Cannot rewrite branches: You have unstaged changes.
当Git没有列出"unstaged"文件时,我怎样知道Git指的是哪些文件,以及如何解决这个问题?
PS:这个问题不是关于存储(stash),我没有存储任何东西,也从未在这个仓库上执行过存储操作。
注意:我运行了git status
并收到以下输出:
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
modified: gf5/console/basic.php
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
//(and a whole long list of files)
git status
返回了什么? - Kyle