Skip to content

Instantly share code, notes, and snippets.

@ddeveloperr
Last active April 4, 2016 18:07
Show Gist options
  • Select an option

  • Save ddeveloperr/404792f2d5f38aee9b83fc7cd75f2de8 to your computer and use it in GitHub Desktop.

Select an option

Save ddeveloperr/404792f2d5f38aee9b83fc7cd75f2de8 to your computer and use it in GitHub Desktop.
Remove multiple deleted files in Git repo

Problem: Remove multiple deleted files in Git repo

Note that '~$' stands for root directory in your terminal

Solutions:

This command will ONLY remove the deleted files from the git:

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

Update all your changes using(Read note above!)

~$ git add -u

changed in Git 2.0 and should not be used anymore!

Another hint for for adding ONLY modified files:

~$ git add $(git ls-files --modified) 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment