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 مثل git.init() ، git.clone("gitrepo destination") ، git.commit() ، git.push() ، git.config() إلخ.
يمكن استبدال أمر GIT مع "-" بـ "_" مثل git rev-parse إلى git.rev_parse ()
يمكنك أيضًا وضع وسيطة أمر GIT في دالة منفصلة مثل git.clone("gitrepo","destination") .
عند الانتهاء من git.clone () دون خطأ ، سينتقل المسار إلى وجهة استنساخ.
لتغيير الموقع الثنائي git ، استخدم:
git.gitbin = "path/to/git/binary"