我有一个脚本,它试图在后台克隆Git存储库,而用户无法提供凭据。因此,它将GIT_SSH_COMMAND设置为启用OpenSSH批处理模式。重现问题的示例脚本:
import subprocess, sys
popen = subprocess.Popen(
['git', 'clone', 'https://github.com/NiklasRosenstein/flux.git'],
env={'GIT_SSH_COMMAND': 'ssh -oBatchMode=yes'},
)
popen.wait()
sys.exit(popen.returncode)在不设置GIT_SSH_COMMAND的情况下,该命令运行良好。但有了它,我得到了
C:\Users\niklas\Desktop
λ test
Cloning into 'flux'...
Error in GnuTLS initialization: Failed to acquire random data.
fatal: unable to access 'https://github.com/NiklasRosenstein/flux.git/': Couldn't resolve host 'github.com'这里出了什么问题?使用Git-for-Windows 2.6.1.windows.1
发布于 2016-10-27 23:27:34
查看一下您的存储库URL。您希望使用ssh或git协议,而不是http/https。
https://stackoverflow.com/questions/35449066
复制相似问题