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 could use <a href="https://pypi.python.org/pypi/GitPython/" rel="nofollow"><code>GitPython</code></a>. Something like this:</p>

<pre><code>    from git import Repo

    repo = Repo.init('/tmp/git_performance_check')
    repo.create_remote('origin', url='ssh://user@host:29418/git_performance_check')
    repo.remotes.origin.fetch()
</code></pre>

python git