code_junkie

git rm multiple files that have already been deleted from disk

Nov 13th, 2011
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. # deleted: file1.txt
  2. # deleted: file2.txt
  3. # deleted: file3.txt
  4. # deleted: file4.txt
  5.  
  6. git rm file1 file2 file3 file4
  7.  
  8. git add -u
  9.  
  10. git commit -m "Deleted files manually"
  11.  
  12. git add -A
  13.  
  14. alias grma='git ls-files --deleted | xargs git rm'
  15.  
  16. git commit -a
  17.  
  18. git rm $(git ls-files --deleted)
  19.  
  20. git status | sed -s "s/^.*deleted: //" | grep "(#|commit)" -v | xargs git rm
  21.  
  22. git-status | sed -s "s/^.*deleted: //" | xargs git rm
Add Comment
Please, Sign In to add comment