Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve the problem that git clone is too slow?

2025-01-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces "how to solve the problem that the speed of git clone is too slow". In the daily operation, I believe that many people have doubts about how to solve the problem that the speed of git clone is too slow. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful for everyone to answer the problem of "how to solve the problem of git clone speed is too slow." Next, please follow the editor to study!

In China, you must find that the speed of using git clone is too slow, and the speed of git clone may be too much for you to bear.

Reason: 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 mapping of ip- > domain name to the hosts file to refresh the DNS cache.

Suitable for all kinds of operating systems, the test system is Ubuntu 18.04.2 LTS, and the download speed is increased from a few k to more than 1m.

Before modification, the speed of git clone is only about 10K, as shown in the figure above.

After modification, the speed of git clone reaches more than 800k. Or more than 1m.

1. Find the ip address corresponding to the domain name, and modify the hosts file

Linuxidc@linuxidc:~/linuxidc.com$ nslookup github.global.ssl.fastly.Net

Server: 127.0.0.53

Address: 127.0.0.53#53

Non-authoritative answer:

Name: github.global.ssl.fastly.Net

Address: 151.101.229.194

Linuxidc@linuxidc:~/linuxidc.com$ nslookup github.com

Server: 127.0.0.53

Address: 127.0.0.53#53

Non-authoritative answer:

Name: github.com

Address: 13.229.188.59

As shown below:

Then modify the hosts file

The path to the hosts file on Windows is in

C:\ Windows\ System32\ drivers\ etc\ hosts

The hosts file path of Linux is in / etc/hosts

Sudo vim / etc/hosts

The hosts file path of Mac is also in / etc/hosts

Sudo vi / etc/hosts

Add two lines at the end of the hosts file

Github.com 13.229.188.59

Github.global.ssl.fastly.Net 151.101.229.194

2. Refresh the DNS cache

Linux:

Sudo / etc/init.d/networking restart

Windows:

Ipconfig / flushdns

Mac:

Sudo killall-HUP mDNSResponder

At this point, the study on "how to solve the problem that the speed of git clone is too slow" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report