How to clone a git repo using python?
<p>I am looking for equivalent way to clone a repo in python</p>

<pre><code>clone_start=`date +%s%N` &amp;&amp; git clone --quiet ssh://$USER@$host:29418/git_performance_check &gt;&amp; /dev/null &amp;&amp; c
lone_end=`date +%s%N`
        Time_clone=`echo "scale=2;($clone_end - $clone_start) / 1000000000" | bc`
</code></pre>

<p>How can I do it ?</p>

<p>You can use <a href="https://pypi.python.org/pypi/GitPython/" rel="nofollow">GitPyhton</a> lib</p>

<p>Clone from existing repositories or initialize new empty ones:</p>

<pre><code>import git
host = 'github'
user = 'root'
git.Git().clone("ssh://{0}@{1}:29418/git_performance_check".format(user, host))
</code></pre>

python git