git命令的包装器

gitcmd的Python项目详细描述


gitcmd

PyPI VersionPyPI Monthly downloadsBuild StatusWheel StatusCoverage report

概述

gitcmd是git命令的包装器,它可以在需要用户名和密码的地方与git命令交互。

安装

快捷方式:

pip install gitcmd

用法

clone git respositroy

from gitcmd import GitCmd
clone_to = 'mydir'
url = "https://github.com/philoprove/gitcmd.git"
ge = GitCmd(work_dir=clone_to, url=url)

如果使用ssh进行克隆,可能首先需要配置ssh密钥。

clone gitlab,用户名,密码

from gitcmd import GitCmd
import os
ge = GitCmd(work_dir="clone_to_where", url="", user="user",pwd="pwd")

# work dir should be either empty or not exists
ge.clone()


# after repository was cloned to local , you can execute other commands
ge.checkout()
ge.pull()
ge.execute("git diff ...")

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java如何制作更好的自定义对话框?   锁定机制锁定UI线程的片段中的java Update ListView   heroku上的java调试嵌入式tomcat   java在使用键时未从映射返回特定数组   使用Blowfish生成secretKey时出现java问题   Appium\MAC OS\Android\Java组织。openqa。硒。SessionNotCreatedException   java在spring boot中解析json响应的最佳方法   java我怎样才能一行一行地看到每一行?   将Java连接到PostgreSQL时强制TZ?   java十六进制到二进制再到字符串   Spark steaming从Kafka中读取并在Java中应用Spark SQL聚合   java使用Cassandra中使用hector客户端的组合键的第一个组件获取行   java类型不匹配:无法从列表<类名>转换为游标:安卓错误   TopCoreDocCollector类型中的java方法create(int,int)不能用于参数(int,boolean)