配置git默认使用IPv4而不是IPv6 [英] Configure git to use IPv4 instead of IPv6 by default

查看:750
本文介绍了配置git默认使用IPv4而不是IPv6的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

检查环境变量和HTTP配置选项并不能揭示某些事情。有没有办法做到这一点?

Checking the environment variables and also HTTP configuration options does not reveal something. Is there a way to do this?

推荐答案

在99%的情况下,您应该不是这样做。这个问题的真正答案是修复您的IPv6连接

In 99% of cases, you should not be doing this. The real answer to the question is fix your IPv6 connection.

如果没有,您可以编辑 / etc / gai .conf 优先选择IPv4 over IPv6。 gai.conf修改了 getaddrinfo()的行为,几乎所有支持IPv6的应用程序都使用它来解析主机名。

Failing that, you can edit /etc/gai.conf to prefer IPv4 over IPv6. gai.conf modifies the behaviour of getaddrinfo(), which almost all IPv6–supporting applications use to resolve hostnames.

几乎所有的系统在其 glibc libc 包中都附带/etc/gai.conf副本。如果/ etc中缺少它,通常我会发现模板副本存在于/ usr / share / doc中的某处,因为您可以将其复制到/ etc并进行相应修改。

Almost all systems ship with a copy of /etc/gai.conf within their glibc or libc package. If it is missing from /etc, usually I find a template copy is lurking somewhere within /usr/share/doc, for you to copy into /etc and modify accordingly.

这篇关于配置git默认使用IPv4而不是IPv6的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆