我想通過我通過以下命令安裝的gitpython
將gerrit項目克隆到本地計算機上。無法通過gitpython克隆存儲庫
pip install gitpython
我有一個python腳本,下面的代碼。
#git.py
import git
git.Git().clone("ssh://[email protected]_ip:port/proj1")
這並沒有給我預期的結果。它給了我以下錯誤。
AttributeError: 'module' object has no attribute 'Git'
我可以運行只git clone ssh://[email protected]_ip:port/proj1
,這工作完全正常,並給了我一個克隆庫,但不通過腳本。
另外,在安裝gitpython
後,我第一次輸入python
命令shell,import git
不給出任何錯誤。但是,如果我在運行上述git.py
腳本之後執行相同的操作,則會得到相同的錯誤AttributeError: 'module' object has no attribute 'Git'
。
我不知道我要去哪裏,想要一些指導。
這真是愚蠢的我......謝謝......那有效:) – nidHi