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"