且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

从“已更改但未更新”中删除所有已删除的文件在Git中

更新时间:2023-12-02 20:47:16

As rampion points out, you can still use git rm to stage the deletion of files that have already been deleted in your working copy (e.g. just git rm dir/file.js in your case.) If you have a lot of these files listed as "deleted:" under "Changed but not updated", I would first check that git ls-files --deleted produces a list of these files, and, if so, delete them with:

git ls-files --deleted -z | xargs -0 git rm