為什麼這篇Python git clone鄉民發文收入到精華區:因為在Python git clone這個討論話題中,有許多相關的文章在討論,這篇最有參考價值!作者ckai007 (Oh ~ My God)看板Python標題[問題] 透過Python 做gi...
前言:
目前想把一些source code管理的工作由jenkins代勞
而製作了一些python code,
在單獨執行自己寫的python 做git clone (透過 ssh rsa_id)動作的時候 整個程式動作
可以正常完成結束
但在jenkins底下透過windows batch去執行python做git clone時候就會出現
git\repo\base.py", line 1148, in clone_from
return cls._clone(git, url, to_path, GitCmdObjectDB, progress, multi_options,
**kwargs)
repo\base.py", line 1086, in _clone
finalize_process(proc, stderr=stderr)
\git\util.py", line 386, in finalize_process
proc.wait(**kwargs)
git\cmd.py", line 502, in wait raise
GitCommandError(remove_password_if_present(self.args), status, errstr)
git.exc.GitCommandError: Cmd('git') failed due to: exit code(128)
cmdline: git clone -v
C:/mytest/test
stderr: 'Cloning into 'C:/mytest/test'...
Host key verification failed.
fatal: Could not read from remote repository
原圖: https://imgur.com/Ex5lv7v.jpg

但有測試過直接在win10下寫一個batch 去呼叫python是可以正常完成clone的動作
請問有沒有甚麼建議或者資料能協助理解這個問題
謝謝高手們囉
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 175.99.136.146 (臺灣)
※ 文章網址: https://www.ptt.cc/bbs/Python/M.1662435524.A.993.html
※ 編輯: ckai007 (175.99.136.146 臺灣), 09/06/2022 13:21:20