Stage all git deletions
Do you often delete files from your git repositories using rm or your text editor/ide file browser? Then you have to git rm all those deleted files, one each time... This little command should help you:
git ls-files -z --deleted | xargs -0r git rm
It supplies git rm with a list of all deleted files on your repository. I use it as git stage-deletions
UPDATE
As pointed by @mlafeldt, if you want to combine this command with a git add
you can use git add -u
, which will stage all modified - but not untracked - files.
Written by Fuad Saud
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Git
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#