2012-09-25 68 views
-2

git add似乎不適用於這些已刪除的文件,那麼如何提交更改?如何提交我使用rm而不是git rm刪除的文件?

$ 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

你究竟想在這裏完成什麼?你是否希望git在提交中記錄你刪除了這些文件? –

+0

相關文章http://stackoverflow.com/questions/1402776/how-do-i-commit-all-deleted-files-in-git – williamcarswell

+0

@ColinR我只是mv ci目錄是網絡 – hugemeow

回答

2

最簡單的選擇是使用git add -A-A選項將分階段添加和刪除文件。

如果您希望使用困難的方法,請在刪除的文件上使用git rm path/file.py來刪除它們(即使您已經手動刪除它們)。