Git不允许我从任何地方rebase。
Cannot rebase: Your index contains uncommitted changes.
Please commit or stash them.
按照这个答案的说明:
$ git update-index -q --ignore-submodules --refresh
$ git diff-files --ignore-submodules
两个都不会产生任何输出,但其中一个确实可以:
$ git diff-index --cached --ignore-submodules HEAD --
:100644 000000 cab819f1e5ed6cc7cff374eecae273e1d6ae6a01 0000000000000000000000000000000000000000 D .idea/codeStyleSettings.xml
:100644 000000 2953f353d2c65dd62e36926accb7f645a600b7e0 0000000000000000000000000000000000000000 D .idea/dictionaries/roxy.xml
:100644 000000 0e7ecef362d8a77067edf4bae5972f33185bd986 0000000000000000000000000000000000000000 D .idea/inspectionProfiles/Project_Default.xml
:100644 000000 3b312839bf2e939fea3ebdef15630a4b33e57caf 0000000000000000000000000000000000000000 D .idea/inspectionProfiles/profiles_settings.xml
:100644 000000 e31af55b33d82e28f471a2ba51b63c2a91fa53b7 0000000000000000000000000000000000000000 D .idea/php.xml
:100644 000000 9c25e8d4f1169b5d3103b14fdb60e7d7c3975b70 0000000000000000000000000000000000000000 D db/sfront.sql
我无法删除这些文件:
$ git rm --cached .idea/php.xml
fatal: pathspec '.idea/php.xml' did not match any files
有什么想法可以帮助我吗?
编辑: git stash
解决了我的问题。虽然我不确定发生了什么,但被抱怨的文件应该被忽略了。
git
检测到这些文件中的更改,则它们先前已被添加到存储库中(这意味着即使它们列在.gitignore
中,它们也不会被忽略——毕竟,您告诉git
它们很重要)。 - larsks