For well-known reasons, accessing Github from a network environment in China is either blocked or very slow. This article provides several ways to get around it.
1. Download Using a Github Mirror
Just prepend a Proxy address to the GitHub repository; the way different Mirrors are concatenated may vary. The example below pulls the https://github.com/shaowenchen/scripts repository.
| |
2. Import the GitHub Project via Gitee
You can refer to the documentation: GitHub仓库快速导入Gitee及同步更新, to import a GitHub repository into Gitee.
Then pull the code using the Gitee address.
3. Configure the Github Host Address
Open https://www.ipaddress.com/ and look up the IP address of github.com
Edit the local /etc/hosts file and add the following content:
| |
After that you can pull the code, but the speed will not be very fast, because Github uses US IPs.
4. Configure a Command-Line Proxy
If you have a usable proxy service, just configure the proxy in your local Terminal.
| |
