【问题标题】:how to commit the files that i delete using rm rather than git rm?如何提交我使用 rm 而不是 git rm 删除的文件?
【发布时间】:2012-09-17 05:51:31
【问题描述】:

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")

【问题讨论】:

标签: git version-control rm


【解决方案1】:

最简单的选择是使用git add -A-A 选项将暂存添加和删除的文件。

如果你想要它,请在已删除的文件上使用git rm path/file.py 进行删除(即使你已经手动删除了它们)。

【讨论】:

    猜你喜欢
    • 2010-12-23
    • 1970-01-01
    • 2023-03-09
    • 1970-01-01
    • 2012-09-06
    • 2011-06-28
    • 2014-05-02
    • 2017-03-06
    相关资源
    最近更新 更多