Problems arising

Git push/git pull/Git push/Git push

【Failed to connect to github.com port 443: Operation timed out】

At this time, a baidu, Google found a solution:

Git config --global https.proxy http://127.0.0.1:1080 git config --global http.proxy http://127.0.0.1:1080Copy the code

At this point you might think: OK finally solved.

However, you may have a similar problem or a new problem the next time you use it.

The solution

step 1

Open the web site: github.com.ipaddress.com/

Do not close the Web page, it will be used later

step 2

Open the web site: fastly.net.ipaddress.com/github.glob…

Do not close the Web page, it will be used later

step 3

Open website github.com.ipaddress.com/assets-cdn….

Do not close the Web page, it will be used later

step 4

Open system host and edit. I’m using a Mac here. The command is as follows:

sudo vim /etc/hosts
Copy the code

Sudo command requires password input. After that, bind the IP and host corresponding to the three Web we opened above, as shown below:

# # IP corresponding host making 140.82.114.4 199.232.69.194 185.199.108.153 github.global.ssl.fastly.net github.com Assets-cdn.github.com 185.199.109.153 Assets-cdn.github.com 185.199.110.153 assets-cdn.github.comCopy the code

The IP address is displayed on the three web pages that you open. Windows please find out how to operate host.

step 5

If http.proxy and HTTPS. Proxy HTTP/HTTPS proxies are configured, you need to disable the proxy.

git config --global --unset http.proxy
git config --global --unset https.proxy
Copy the code

step 6

Refresh the DNS. If the DNS cache does not work, restore the DNS cache in OS X by yourself

https://support.apple.com/zh-cn/HT202516
Copy the code

It’s ready for normal use here.