-2

git add seems not works for these deleted files, so how to commit the changes?

$ 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")
hugemeow
  • 7,777
  • 13
  • 50
  • 63
  • What exactly are you trying to accomplish here? Do you want git to record in a commit that you deleted the files? – Colin R Sep 25 '12 at 16:56
  • Related post http://stackoverflow.com/questions/1402776/how-do-i-commit-all-deleted-files-in-git – williamcarswell Sep 25 '12 at 16:59
  • @ColinR i just mv ci directory to be web – hugemeow Sep 25 '12 at 17:31
  • So you want to add the files you moved from `ci` to `web` to the commit? Have you tried `git add .` (this will add all untracked and unignored files)? – Colin R Sep 25 '12 at 17:35
  • possible duplicate of [Removing multiple files from a Git repo that have already been deleted from disk](http://stackoverflow.com/questions/492558/removing-multiple-files-from-a-git-repo-that-have-already-been-deleted-from-disk) – William Pursell Nov 21 '12 at 08:38

1 Answers1

2

The simplest option is to use git add -A. The -A option will stage added and removed files.

If you want it the hard way, use git rm path/file.py on your deleted file to stage their deletion (even if you've already deleted them manually).

Simon Boudrias
  • 42,953
  • 16
  • 99
  • 134