Home  >  Article  >  Development Tools  >  Several ways to solve the problem of being unable to enter GitHub in China

Several ways to solve the problem of being unable to enter GitHub in China

PHPz
PHPzOriginal
2023-04-10 09:38:5921375browse

GitHub is one of the most famous code hosting platforms in the world, providing developers and technology enthusiasts around the world with a complete platform for code, documentation, project management and other functions. However, due to various reasons, domestic access to GitHub is often restricted, making it difficult for users to directly access the website. This article will introduce you to several methods to solve the problem of being unable to enter GitHub in China.

1. Scientifically surf the Internet

The simplest and most commonly used method is to scientifically surf the Internet.

2. Change the hosts file

It should be easy to find content related to the hosts file under Windows. Just enter the C drive/windows/system32/drivers/etc/ directory and you can see it. hosts file. For operating systems such as Mac OS, you can open the etc directory in the terminal and edit the hosts file through an editor such as VI. Just add the following content to the end of the hosts file:

13.250.177.223 github.com
140.82.114.4 gist.github.com
185.199.110.153 assets-cdn.github.com
199.232.96.133 raw.githubusercontent.com
199.232.96.133 user-images.githubusercontent.com
199.232.96.133 gist.githubusercontent.com
199.232.96.133 cloud.githubusercontent.com
199.232.96.133 camo.githubusercontent.com

Since GitHub's server address changes frequently, the hosts file needs to be updated regularly to access GitHub.

3. Use CDN to solve

In addition to changing the hosts file, you can also use CDN to solve the problem of being unable to enter GitHub in China. CDN (Content Delivery Network) is the abbreviation of content delivery network. Its function is to provide users with faster and more efficient data access services.

There are many domestic CDN vendors that provide acceleration services for GitHub. For example, CNPM, jsdelivr, etc. have provided their users with CDN speed-up services for GitHub. Users can use these CDN addresses in their browser to open GitHub in a faster way.

4. Use the mirror site

In addition to using the scientific Internet, changing the hosts file, and using CDN, you can also access the GitHub mirror site. Many domestic technical teams and community volunteers have launched GitHub mirror sites. These sites are usually established in China, and the content is updated simultaneously with GitHub. Users can use domestic mirror sites to access GitHub. Here are some open source GitHub mirror sites:

  • https://github.com.cnpmjs.org/
  • https://hub.fastgit.org/
  • https://gitclone.com/
  • https://github.wuyanzheshui.workers.dev/

Summary

The above are several domestic solutions Methods for not being able to enter GitHub. Each of these methods has its own characteristics, but they all allow users to successfully access GitHub. Which method to use can be chosen based on your own needs and habits.

At the same time, we must also continue to call on relevant institutions to speed up the support and introduction of GitHub to alleviate the long-term problems of netizens switching tool chains and restricted access, so that Chinese technology enthusiasts can more easily integrate into global technology cutting edge.

The above is the detailed content of Several ways to solve the problem of being unable to enter GitHub in China. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn