Instantly share code, notes, and snippets.

Embed
What would you like to do?
>>> import subprocess
>>> proc = subprocess.Popen(['git', 'clone', 'git@github.com:getsentry/sentry.git', '/tmp/ds-repo-1'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
>>> print(proc.communicate())
("Cloning into '/tmp/ds-repo-1'...\n", None)
@vartec

This comment has been minimized.

Show comment
Hide comment
@vartec

vartec Feb 13, 2015

>>> subprocess.check_output("git clone git@github.com:getsentry/sentry.git /tmp/ds-repo-1", shell=True)
Cloning into '/tmp/ds-repo-1'...
remote: Counting objects: 76488, done.
remote: Compressing objects: 100% (425/425), done.
remote: Total 76488 (delta 285), reused 0 (delta 0)
Receiving objects: 100% (76488/76488), 31.78 MiB | 1.01 MiB/s, done.
Resolving deltas: 100% (41870/41870), done.
Checking connectivity... done.

raises CalledProcessError on non-zero exit code.

vartec commented Feb 13, 2015

>>> subprocess.check_output("git clone git@github.com:getsentry/sentry.git /tmp/ds-repo-1", shell=True)
Cloning into '/tmp/ds-repo-1'...
remote: Counting objects: 76488, done.
remote: Compressing objects: 100% (425/425), done.
remote: Total 76488 (delta 285), reused 0 (delta 0)
Receiving objects: 100% (76488/76488), 31.78 MiB | 1.01 MiB/s, done.
Resolving deltas: 100% (41870/41870), done.
Checking connectivity... done.

raises CalledProcessError on non-zero exit code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment