Configure git to use IPv4 instead of IPv6 by default

前端 未结 5 596
天命终不由人
天命终不由人 2020-12-13 02:49

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

5条回答
  •  南方客
    南方客 (楼主)
    2020-12-13 03:31

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

    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.

    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.

提交回复
热议问题