Python的方式来克隆一个Git仓库 [英] Python way to clone a git repository

查看:663
本文介绍了Python的方式来克隆一个Git仓库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有使用子进程来克隆git存储库的Python方式?我渴望使用你推荐的任何模块。

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.

推荐答案

http://gitorious.org/git-python/ 。在之前和内部没有听说过,它依赖于git可执行文件的某处;另外,他们可能有很多bug。但它可能值得一试。

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.

如何克隆:

import git
git.Git("/your/directory/to/clone").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.)

这篇关于Python的方式来克隆一个Git仓库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆