从已从磁盘中删除的Git存储库中删除多个文件

故事扮演 提交于 2020-08-11 19:29:24

问题:

I have a Git repo that I have deleted four files from using rm ( not git rm ), and my Git status looks like this: 我有一个Git repo,我已经删除了使用rm而不是 git rm )的四个文件,我的Git状态如下所示:

#    deleted:    file1.txt
#    deleted:    file2.txt
#    deleted:    file3.txt
#    deleted:    file4.txt

How do I remove these files from Git without having to manually go through and add each file like this: 如何从Git中删除这些文件,而无需手动浏览并添加如下所示的每个文件:

git rm file1 file2 file3 file4

Ideally, I'm looking for something that works in the same way that git add . 理想情况下,我正在寻找与git add .相同的方式git add . does, if that's possible. 如果那是可能的话。


解决方案:

参考一: https://stackoom.com/question/248U/从已从磁盘中删除的Git存储库中删除多个文件
参考二: https://oldbug.net/q/248U/Removing-multiple-files-from-a-Git-repo-that-have-already-been-deleted-from-disk
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!