Skip to content

Instantly share code, notes, and snippets.

View jesuscast's full-sized avatar

Andres Castaneda jesuscast

View GitHub Profile
@jesuscast
jesuscast / rmAll.py
Last active December 20, 2015 00:19
Removes all of the deleted files in git if there is any modified neither new files on stage
import subprocess
import re
def rmAll():
output = subprocess.check_output("git status", shell=True)
matches = re.findall('deleted: .*', output)
for n in matches:
clean = n.replace("deleted: ","")
subprocess.call("git rm "+clean, shell=True)