GitHub Clone Is Very Slow, GitHub Cannot Be Uploaded, github.io Cannot Be Accessed

Question

Github is a must-have code repository and learning website for programmers, but when you find an open source library and clone it, you find that it has been stuck, and the download speed is only a few k in time.

And, although you can go to github, careful students can find that most of the pictures on the github site cannot be opened.

The blogs or documents of other projects are hosted on github.io, and this URL is often inaccessible.

Are there any remedies?

Solution

First of all, refer to the wisdom of many netizens, and we will have a plan immediately

Option 1: Set up git config

Modify the configuration of git

git config --global http.postBuffer 524288000

Some students have used this configuration, the speed has been improved, but the editor used it to no effect, it may still depend on the network reason.

Option 2: cnpm mirroring

The service of cnpm, a large-scale domestic mirroring system, is here again!

The operation is very simple, as long as we replace the https://github.com in the original website with https://github.com.cnpmjs.org, for example,

git clone https://github.com/openHacking/vuepress-plugin-qrcode

Can be changed to

git clone https://github.com.cnpmjs.org/openHacking/vuepress-plugin-qrcode

After experimenting, the author found that the speed has indeed improved, and the speed is about 500k when it is fast. But because mirroring has a synchronization cycle, if you are a small partner who has a high real-time requirement, you need to pay attention to this problem.

Scheme 3: gitee synchronization

This is a one-click synchronization service using the github repository of gitee.com to do a transfer and achieve the purpose of quickly downloading github projects.

Specific operation:

  1. Register [gitee]

  2. Via [gitee][Import existing projects from github]

  3. git clone [gitee] the project

Note: The author has tested that synchronization is indeed possible, and the gitee speed is quite fast. But there are two disadvantages: 1. It is a bit troublesome to synchronize and download every time a library is seen. 2. If the warehouse is too large, it will not be synchronized. So this plan is not a panacea.

Option 4: Modify the host file

Git clone is particularly slow because the github.global.ssl.fastly.net domain name is restricted. Just find the ip address corresponding to this domain name, and then add the ip–>domain name mapping in the hosts file to refresh the DNS cache.

Specific operation:

  1. Search separately on the website https://www.ipaddress.com/:
github.global.ssl.fastly.net
github.com

Get the ip address

  1. Open the hosts file -The path of the hosts file on Windows is in C:\Windows\System32\drivers\etc\hosts -The path of Linux hosts file is: sudo vim /etc/hosts
  1. Add two lines at the end of the hosts file (corresponding to the ip found above)
151.101.185.194 github.global-ssl.fastly.net
192.30.253.112 github.com
  1. Save and update DNS -The method of Winodws system: open CMD, enter ipconfig /flushdns -Linux method: enter sudo /etc/init.d/networking restart in the terminal

  2. Try again git clone

Note: It is recommended to test the services obtained by several ip addresses, because ip is also contaminated, and usually an ip is not necessarily reliable. After trying the author, I found that this method is not very effective. git clone is still fast.

Option Five: Agency

Through the local proxy software, the github proxy is forwarded to a server that can be accessed at high speed. There are many application scenarios for proxy technology, and it is one now.

General steps:

  1. Most students will recommend shadowsocks, plus a free prostitute account, you can link to it
  2. Set up github proxy
git config --global http.https://github.com.proxy https://127.0.0.1:1080
git config --global https.https://github.com.proxy https://127.0.0.1:1080

Note that this is effective for https warehouse links.

After finishing the experiment, I found that the proxy did not work. It has been shown that the connection was made, but the internet speed was still moving. I don't know what went wrong. Welcome to tell the editor in the message area of ​​successful test partners.

In fact, the editor estimates that everyone has tried all the solutions, and the effect is still not satisfactory. After a whole working day of research and sad tears, the editor finally found an ultimate trick: EXPRESS.

Because the editor has figured out one thing, as a qualified programmer, there is no powerful agent software that can stabilize output and is strong and rigid, and it is impossible to enjoy a smooth development experience normally. Now it’s the age of 5G communication ,downloading github's code is still at a speed of 5k, and I can’t accept it anymore.

There may be some small partners who have studied this area, and it may have become everyone's daily preparation tool. If you have any doubts about this, the editor recommends that you read the following article carefully. After reading this heart-warming article carefully, the editor quickly started, and solved the problem of the editor’s years of surfing the Internet.

A must-have Internet tool for programmers

This is the most stable and fastest proxy service I have ever used, none of them.

Do it yourself, and you're half done.

Comments