Gitpybinding
1.0.0
完全git命令绑定Python,与所有Git和Python 2&3版本兼容。
pip install gitbinding
from gitbinding import Git
git = Git ( path = None , direct_output = True )
"""
path:
working directory, None = use current directory.
direct_output:
if direct_output set to False, the output is redirect to command/function return.
"""现在,您可以运行任何git.init() , git.clone("gitrepo destination") , git.commit() , git.push() , git.config()等的任何git命令,
git命令用“ - ”可以用“ _”替换为git rev-parse到git.rev_parse()
您还可以将git命令参数放在单独的函数中,例如git.clone("gitrepo","destination") 。
当git.clone()完成无错误时,路径将自动移动到克隆目的地。
要更改git二进制位置,请使用:
git.gitbin = "path/to/git/binary"