Use Git commands within Python code

An easier solution would be to use the Python subprocess module to call git. In your case, this would pull the latest code and build:

import subprocess
subprocess.call(["git", "pull"])
subprocess.call(["make"])
subprocess.call(["make", "test"])

Docs:

Leave a Comment