Git中是否有可能将文件从索引中删除?
我想做:
git rm --cached file.autogenerated.txt
git stash -m "untrack file.autogenerated.txt"
创建藏匿处,但似乎在藏匿处没有任何东西 - 只有0个文件更改,0插入,0删除。应用此藏匿没有任何效果。
我也尝试过:
git rm --cached file.autogenerated.txt
git stash --include-untracked -m "untrack file.autogenerated.txt"
但同样,这也没有效果。
有什么办法可以将索引中的文件删除?
I want to do:
git rm --cached file.autogenerated.txt
git stash -m "untrack file.autogenerated.txt"
The stash is created but it doesn't seem to have anything in the stash - just 0 files changes, 0 insertions, 0 deletions. And applying this stash has no effect.
I also tried:
git rm --cached file.autogenerated.txt
git stash --include-untracked -m "untrack file.autogenerated.txt"
But likewise this had no effect.
Is there any way to stash a removal of a file from the index?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 git stash pop --index 重新应用删除,例如
You can re-apply the deletion using
git stash pop --index
, e.g.