Remove multiple deleted files in git

Sometimes when you are committing changes in git you’ll find that a number of files have been deleted.

You could manually set these files to delete by individually issuing the command:

git rm filename

However, there is a shortcut. If you issue the command:

git ls-files --deleted

It will return a list of all files that are flagged as deleted.

You can then simply pass that list to git rm, using a combined syntax like this:

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

Just don’t forget the--deleted parameter!




Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Facebook Knows What You Eat: Discover The Entire Data Facebook Collects About You, Step By Step.

Design SaaS Product: 4 Reasons Why You Should Choose Ruby On Rails Framework

What happens when you type ls *.c

Best Conga Composer Alternatives for Salesforce

Web development basic syntax

Build a Go based REST API to query time series tweet data in Cassandra

Advantages of the Crodo project !!!

This is the right time to learn iOS App Development

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Praj Basnet

Praj Basnet

More from Medium

Github configuration in local machine

GIT Commands

Setup Multiple Git Accounts on Machine