git add似乎不适用于这些已删除的文件,那么如何提交更改?
$ git status
# On branch master
# Changes not staged for commit:
# (use "git add/rm <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# deleted: ci/ci/__init__.py
# deleted: ci/ci/settings.py
# deleted: ci/ci/urls.py
# deleted: ci/ci/wsgi.py
# deleted: ci/manage.py
#
no changes added to commit (use "git add" and/or "git commit -a")
答案 0 :(得分:2)
最简单的选择是使用git add -A
。 -A
选项将暂存已添加和删除的文件。
如果您想要这么做,请在已删除的文件上使用git rm path/file.py
进行删除(即使您已手动删除它们)。