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?

  • pip unexpectedly not installing latest version of git package with branch/commit pinning
  • What do I need to read to understand how git works?
  • Visual Studio: Change default path for repositories for GIT plugin
  • using git to clone a CodePlex project that uses SVN
  • Git is doing very slow commits on a Samba share. What can I do to speed it up?
  • How can I restart git bash?
  • git: can't push (unpacker error) related to permission issues
  • Gitignore not working
  • How do I build and use the latest version of git on cygwin?
  • Why hg always commit a git submodule, even if it hasn't changed?
  • Heroku & Django: “OSError: No such file or directory: '/app/{myappname}/static'”
  • Undo a merge by pull request?
  • 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.