git fatal:拒绝使用缺少主机字段的凭据
克隆 git 存储库时出现错误 致命:拒绝使用缺少主机字段的凭据
早些时候,我收到了 ssl 握手错误,因此,在 git 配置文件中添加以下内容后,现在我遇到了提到的致命错误。
sslCert = ~/xyz.crt
sslKey = ~/xyz.key
sslVerify = false
sslCertPasswordProtected = false
我也尝试通过添加以下内容来添加,但没有成功:
[url "https://hostname"]
insteadOf = git://hostname
git credential批准
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>
致命:拒绝使用凭据缺少主机字段
While cloning git repository, I am getting errorfatal: refusing to work with credential missing host field
Earlier i was getting ssl handshake error so, after adding below in git configuration file, now i am stuck with mentioned fatal error.
sslCert = ~/xyz.crt
sslKey = ~/xyz.key
sslVerify = false
sslCertPasswordProtected = false
also i tried adding by adding below but no success:
[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.
Also, used as below
protocol=https
host=www.abc.com
username=yuyiuyiuy
password=78yhkjh
url=<git repo path>
fatal: refusing to work with credential missing host field
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
这帮助了我:
This helped me:
对于 MacOS 上的我来说,当我尝试将 .gitconfig 文件重命名为 .xgitconfig (或者只是删除 git 的全局配置文件)时,一切都很顺利,并且通过 HTTPS 克隆远程存储库工作正常。
For me on MacOS, when I tried to rename the .gitconfig file to .xgitconfig (or just delete the global config file of git), then everything went fine, and cloning the remote repo via HTTPS worked fine.
我认为有几个因素可能会导致此错误。当 sslCert 和 sslKey 的路径中有拼写错误时,我看到了此错误。
I think there are several things that can go wrong that can cause this error. I have seen this error when I had a typo in the paths for sslCert and sslKey.
只需从“.gitconfig”中删除相对路径
Just remove the Relative Paths from your ".gitconfig"