Step 1: get ip
Search separately on the following website https://www.ipaddress.com/:
github.global.ssl.fastly.net
github.com
Then record the resulting IP address
Step 2: Modify host
In Windows, first enter: C:\Windows\System32\drivers\etc directory,
then right-click the hosts file and open it with a file compiler. I am using Sublime Text here, or you can use other text editors such as Notepad++ to
add to the file these two lines
151.101.1.194 github.global-ssl.fastly.net
140.82.112.3 github.com
Note: The above ip should be replaced by your own search,
then ctrl s to save
Extension 1: If the host cannot be saved
If the following error is prompted
, refer to this article here, modify the permissions of the hosts file
https://blog.csdn.net/WZH577/article/details/115386190
and then ctrl s can be saved
The main reference article for this article:
https://zhuanlan.zhihu.com/p/58006202
Extension 2: Configuration when using a proxy
When using the proxy, if you encounter the following errors,
add it to the command line:
git config --global http.proxy 'socks5h://127.0.0.1:7890'
git config --global https.proxy 'socks5h://127.0.0.1:7890'
git config --global http.proxy 'socks5h://127.0.0.1:1080'
git config --global https.proxy 'socks5h://127.0.0.1:1080'
git config --global http.proxy 'socks5h://127.0.0.1:1086'
git config --global https.proxy 'socks5h://127.0.0.1:1086'
You can execute one of these three, if one is not working, try another one, depending on which port your agent uses