tags:

views:

161

answers:

2

Is there a Python way without using a subprocess to clone a git repository? I'm up for using any sort of modules you recommend.

+2  A: 

There is http://gitorious.org/git-python/ . Haven’t heard of it before and internally, it relies on having the git executables somewhere; additionally, they might have plenty of bugs. But it could be worth a try.

How to clone:

import git
git.Git().clone("git://gitorious.org/git-python/mainline.git")

(It’s not nice and I don’t know if it is the supported way to do it, but it worked.)

Debilski
I don't believe this clones.
Jefromi
It does. But it is a little convoluted.
Debilski
Oh, my bad, I missed that possibility. Mike, just remember, internally this is just calling the git executable anyway; it's just managing it a little for you.
Jefromi
I looked at gitorious.. just overlooked the clone option since its not documented at all.. but I expected whatever i used to to some sort of process command.. this works thanks!
Mike
A: 

Dulwich is a pure-Python implementation of Git that does not fork at all. Be aware that it's still under development, so it may be buggy.

Mark Lodato