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 if you can't access GitHub?

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)05/31 Report--

Today, I would like to share with you the relevant knowledge points that GitHub access can not solve. The content is detailed and the logic is clear. I believe most people still know too much about this knowledge, so share this article for your reference. I hope you can get something after reading this article. Let's take a look at it.

1. Change to hosts

When we enter the URL of GitHub in the browser, we send a request to the DNS server to get the IP address of the server where the GitHub website is located.

Just like you are a courier, you should find a middleman to inquire about the address of the recipient before sending the delivery. DNS is the middleman who tells you the destination address. If DNS tells you the wrong address, or the request is blocked, or the DNS fails, you will not be able to access the site.

Image

Is there any way to get the corresponding IP of the URL without going through DNS?

The answer is to modify the hosts file. When the customer enters the URL in the browser, the system will first automatically look for the corresponding IP address from the hosts file. Once found, the system will immediately open the corresponding web page. If it is not found, the system will submit the URL to the DNS domain name resolution server for IP address resolution.

Therefore, to access GitHub, we can first obtain the real address of the current GitHub site through the IP query tool, and then modify the local hosts file to associate the address with the GitHub URL.

IP query

First find the location of the hosts file. The storage location of the hosts file varies with different operating systems:

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

Linux system: / etc/hosts

Mac (Apple computer) system: / etc/hosts

Android (Android): / system/etc/hosts

IPhone (iOS) system: / etc/hosts

Open the hosts file, add a line, and replace xx with the parsing address you queried:

Xx.xx.xx.xx www.github.com

But this method is more troublesome, and the queried IP may not support domestic access, so here is another simpler way to recommend!

2. GitHub520

With so many programmers in China, there must be people who will come forward and deal with the problem that people can't access GitHub.

GitHub520 is a project to help people access GitHub, which is essentially achieved by modifying hosts. The author of the project provides you with a complete list of hosts. There is no need for you to query the available IP. It is very sweet and will be upgraded every day!

Hosts list

In addition, in order to make it easier for you to upgrade your local hosts, the author also provides tutorials to automatically upgrade hosts content on a regular basis, such as using the SwitchHosts tool. Configure once, rest easy!

Image

Of course, if you no longer have access to GitHub, you can first obtain the initial hosts address in the programming navigation, and then configure it in the first way in this article.

3. Speed up download

If through the above two ways, still can not access the GitHub, or the access speed is very slow. Then we can change our way of thinking and download the projects on GitHub directly to the local area.

There are many websites that support accelerated downloading of GitHub, such as GitClone, which can be downloaded at a high speed by entering the project name!

Image

But this method is only suitable for downloading projects for use or learning, and you still can't submit code to GitHub.

4. Gitee import

Gitee is a domestic version of GitHub, which supports importing existing GitHub repositories directly when you create a new project. If you want to download the source code of which project, enter the corresponding GitHub warehouse address directly!

Image

You can also synchronize the Gitee repository with the GitHub repository at any time, and after the repository is synchronized, you can submit and manage the code here.

Synchronous warehouse

These are all the contents of the article "how can't be solved by GitHub access"? thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.

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

Internet Technology

Wechat

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

12
Report