[英]How i can clone my the git repository using Python and PyGithub/GitPython?
Here I was looking around write some code through which I can maintain my git repository. 在这里,我环顾四周编写一些代码,通过这些代码可以维护我的git存储库。
I am python beginners level but i know it. 我是python初学者,但我知道。 My repository on git hub is.
我在git hub上的存储库是。
https://github.com/gtrdotmcs/NewDjango/
I would really like to clone,pull,commit and push my repository using python code. 我真的很想使用python代码克隆,拉动,提交和推送我的存储库。
Yeah it not easy for beginners but I would really like to do it. 是的,对于初学者来说并不容易,但我真的很想这样做。 Coming around i came with some python libraries for github.
到处走走,我为github提供了一些python库。 PyGithub and GitPython
PyGithub和GitPython
I would also like to know which is better one? 我也想知道哪个更好?
PyGithub is a library for interacting with the GitHub API; PyGithub是一个用于与GitHub API交互的库; it will not let you clone your repository or otherwise interact with a local git repository.
它不会让您克隆存储库或以其他方式与本地git存储库进行交互。
GitPython is a Python interface to git
and can be used to clone a remote repository. GitPython是
git
的Python接口,可用于克隆远程存储库。 In fact, there's an example of exactly that at the beginning of the tutorial to which you have linked. 实际上,在您已链接到的教程的开头,确实有一个示例。
That said, it's not clear from your question exactly what you hope to accomplish -- learning the git
commandline interface is an important skill if you're going to be working with GitHub (or git
in general). 就是说,从您的问题中尚不清楚您希望完成什么—如果您要使用GitHub(或一般而言,
git
),学习git
命令行界面是一项重要技能。 While you can probably perform many of the same tasks with GitPython
, you are arguably going to be spending much of your time duplicating the existing functionality of the commandline tools. 尽管您可以使用
GitPython
执行许多相同的任务,但可以说您将花费大量时间来复制命令行工具的现有功能。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.