As we all know, GitHub is the world's largest "same-sex" communication platform. We can use GitHub as our remote code repository and push our projects up for management. However, GitHub exists as a foreign website. When we use it, we always encounter some slow speeds, especially when we want to clone a project locally through git, we will find that the speed is too slow. Usually only a few tens of KB. The project is small, it can be cloned after a while, but when the project is too large, the waiting time will be abnormally long, which is unbearable. After searching some network information, the problem of too slow speed has been solved smoothly, now share it with everyone~
1. Register a code cloud account
Here we register a code cloud account, which is a code hosting platform under Open Source China, address: https://gitee.com/. Because it is domestic, cloning code from Code Cloud will be much faster than cloning on GitHub. Our idea is to clone our code through Code Cloud instead of GitHub, hehe~
2. Import the projects on GitHub into Code Cloud
Copy the corresponding warehouse URL on GitHub
Enter from the homepage after registration
Fill in the URL just copied, fill in the creation warehouse
As you can see, the project has been placed under the code cloud
3. Add the public key to the newly registered code cloud
If you have registered the code cloud before and have added the public key, you can skip to the fourth step directly
Here is cloned by SSH.
Here is the storage location of the public key. If there is no .ssh directory, it is because the machine has not been generated yet. How to use git generation is not explained in detail.
We open it through a notepad and copy the public key
Add the public key just copied to the code cloud
Enter settings
Just take a title and add the public key you just copied
Verify identity by password
Okay, successfully added~
4. Clone the project on Code Cloud to local
Copy the SSH link of the project
Clone to local
As you can see, the speed is very impressive~~
5. Push the project to GitHub
We have cloned the project locally, of course we also need to push back to the GitHub repository.
However, at this time, our locally associated code repository is associated with the newly registered code cloud, not GitHub.
Modify the push address of the local warehouse to GitHub
You can see that the code has been downloaded locally. At this time, we need to open the .git directory under the project directory.
Many people can't see this file by default, and we need to show hidden files.
Enter the .git directory and open the configuration file with Notepad, etc.
As you can see, here is the position on the code cloud just cloned
Here we need to modify the address here to the address on GitHub
Find the corresponding project on GitHub and copy the address
Replace
Modify the content of the project and push it
As you can see, the push to GitHub was successful~~