import subprocess
def stage_file(filename):
    return subprocess.call(["git", "add", filename])
import subprocess
def stage_file(filename):
    return subprocess.call(["git", "add", "-A", filename])
Fix so that deleted files are added also - previous command gave a warning in older versions of git.