0
我有以下Python代碼:GIT許可拒絕(公鑰)
import subprocess
import os
repo_dir = 'C:\dev\codeRepo'
os.chdir(repo_dir)
process = subprocess.Popen("git pull", stdout=subprocess.PIPE)
output = process.communicate()[0]
我收到以下錯誤:
Permission denied (publickey). fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
注意,我有公共密鑰設置在服務器上,我可以從Windows命令行執行「git pull」,而不必輸入任何密鑰,並且它可以工作。但是,從Python程序中我得到這個錯誤。