git fatal:拒绝使用缺少主机字段的凭据

6tdlim6h  于 2023-06-20  发布在  Git
关注(0)|答案(2)|浏览(371)

在克隆git仓库时,我收到错误fatal: refusing to work with credential missing host field
早些时候我得到了ssl握手错误,所以,在git配置文件中添加以下内容后,现在我被提到的致命错误卡住了。

sslCert = ~/xyz.crt
    sslKey = ~/xyz.key
    sslVerify = false
    sslCertPasswordProtected = false

我也试着在下面添加,但没有成功:

[url "https://hostname"]
    insteadOf = git://hostname

git credential approve

protocol=https
host=www.abc.com
username=yuyiuyiuy
password=78yhkjh


warning: ----------------- SECURITY WARNING ----------------
warning: | TLS certificate verification has been disabled! |
warning: ---------------------------------------------------
warning: HTTPS connections may not be secure. See https://aka.ms/gcm/tlsverify for more information.
warning: failed to probe 'http(s)://www.abc.com/' to detect provider
warning: An error occurred while sending the request.
warning: see https://aka.ms/gcm/autodetect for more information.

同样,如下所示

protocol=https
host=www.abc.com
username=yuyiuyiuy
password=78yhkjh
url=<git repo path>

fatal:拒绝使用缺少主机字段的凭据

4dbbbstv

4dbbbstv1#

这帮助了我:

...
[http]
    sslbackend = openssl
...
e0bqpujr

e0bqpujr2#

对我来说,在MacOS上,当我试图将.gitconfig文件重命名为.xgitconfig(或者只是删除git的全局配置文件)时,一切都很好,通过HTTPS克隆远程存储库也很好。

相关问题