我做了以下(为了学习git rm
)。
在空文件夹上创建了一个空存储库。创建了一个名为 test.txt 的文件,对其进行修改,然后运行以下命令(以及随之而来的结果)。
git rm test.txt -> `fatal: pathspec 'test.txt' did not match any files`
git add test.txt && git rm test.txt ->
error: 'test.txt' has changes staged in the index
(use --cached to keep the file, or -f to force removal)
所以,我的问题是:
test.txt 什么时候git rm
真正有用?