Gitpybinding
1.0.0
すべてのGitおよびPython 2&3バージョンと互換性があるPython用の完全なgitコマンドバインディング。
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.clone("gitrepo","destination")のような個別の関数にgitコマンド引数を配置することもできます。
git.clone()がエラーなしで終了すると、パスは自動移動します。
gitバイナリの場所を変更するには、使用してください。
git.gitbin = "path/to/git/binary"