If you are looking for software to use, go to Huajun Software Park! software release
Location: front pageTutorial strategyTutorialComputer software tutorials Can't enter github...

What should I do if I can’t access github? -Solution to the problem of not being able to enter github

author: Date: 2024-03-19

GitHub Desktop
GitHub Desktop-2.9.4.0 official version

programming tools Storage: 109MB Time: 2023-04-10

Software introduction: GitHub Desktop (GitHub desktop version), GitHub is currently the most popular public code warehouse website, and most well-known open source projects...

Download now

1. Scientific Internet access

However, there are also some problems. For example, package downloads are still slow. Different suppliers and implementation methods have different effects. For example, corporate business purposes such as corporate declarations and foreign company VPN tunnels are normal, but personal use is not necessarily the case.

If it is a server that provides services to me, this method may not be appropriate.

2. Use a proxy

From actual observations, a reverse proxy should be used. Using such an IP (domain name) can not only allow normal access within the country, but also normal access to GitHub. Then build a reverse proxy on the host of this IP to receive For domestic visits, the proxy requests GitHub and returns the results to the visitor.

This method only requires changing the domain name of github.com as the proxy. The usage method is the same as GitHub except for the domain name. It is very fast, can be logged in, and can be submitted. There are many similar sites, but service continuity and stability are generally not strong (security needs to be verified), but the cost is low, simple and convenient. For example, https://kgithub.com (this address may become invalid later), there are also people who specifically enumerate and update the list of valid agents.

There are two ways to specifically replace the address of github.com. One is to directly modify the address of the specific warehouse with git remote, and the other is to modify git globally, as follows:

git config --global url."Proxy address such as https://kgithub.com/".insteadOf "https://github.com/" # Global modification

git config --global --list # View configuration

git config --global --unset url.https://github.com/.insteadof # Cancel modifications

3. Modify hosts

Ubuntu system: sudo vim /etc/hosts
Windows system: Open C:WindowsSystem32driversetc and find the hosts file

Add the content obtained in the first three steps at the bottom, namely:


140.82.113.4 github.com 199.232.69.194 github.global.ssl.fastly.net 185.199.108.153 assets-cdn.github.com 185.199.109.153 assets-cdn.github.com 185.199.110.153 assets-cdn.github.com 185.199.111.153 assets-cdn.github.com


Save and exit. Restart the browser and visit again.

4. Use mirroring

Synchronize, make a copy of the actual content on GitHub, and make it accessible. This method is more costly and less timely, but it also provides some value-added services. Such as gitclone.com.


The above is all about the solution to the problem of not being able to access github. I hope it will be helpful to you.

Related articles