Last active
December 20, 2015 00:19
-
-
Save jesuscast/6040997 to your computer and use it in GitHub Desktop.
Removes all of the deleted files in git if there is any modified neither new files on stage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment