How to handle a bunch of deleted files under Git?

I have deleted about 20 files from my project. How to commit them with one command instead of git rm <filename> them one by one?

  • You need the NDKr9 or later
  • CLI git log statistics
  • cygwin git thinks that file previously had different mode
  • How can I discard modified files?
  • Control polling frequency with Jenkins Git polling + hook
  • Why I am always one commit behind from my own remote git repo?
  • Better control of git log formatting
  • Project Documentation: Create wiki pages, or create Markdown files in the repo?
  • Is there a way to invoke a script on git status command?
  • Git repository is out of sync after rebase
  • Git ignoring add with wildcard for some files
  • git checkout a remote branch says fatal: Not a valid object name: 'origin/user/branch'
  • 2 Solutions collect form web for “How to handle a bunch of deleted files under Git?”

    If you don’t want to commit all other changes in your working directory at the same time (as git add -A would do), you can use

    git rm $(git ls-files --deleted)

    git add -A will add all changes, including deletions, to the index. Then commit away.

    Git Baby is a git and github fan, let's start git clone.