Windows solves the problem of slow cloning of GitHub projects to local

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
Insert picture description here
Enter from the homepage after registration
Insert picture description here
Fill in the URL just copied, fill in the creation warehouse
Insert picture description here
As you can see, the project has been placed under the code cloud
Insert picture description here

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.
Insert picture description here
We open it through a notepad and copy the public key
Insert picture description here
Add the public key just copied to the code cloud

Enter settings
Insert picture description here
Just take a title and add the public key you just copied
Insert picture description here
Verify identity by password
Insert picture description here
Okay, successfully added~
Insert picture description here

4. Clone the project on Code Cloud to local

Copy the SSH link of the project
Insert picture description here
Clone to local
As you can see, the speed is very impressive~~
Insert picture description here

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.

Insert picture description here
Enter the .git directory and open the configuration file with Notepad, etc.
Insert picture description here
As you can see, here is the position on the code cloud just cloned
Insert picture description here
Here we need to modify the address here to the address on GitHub

Find the corresponding project on GitHub and copy the address
Insert picture description here
Replace
Insert picture description here
Modify the content of the project and push it
Insert picture description here
As you can see, the push to GitHub was successful~~
Insert picture description here

Guess you like

Origin blog.csdn.net/qq_45590494/article/details/104724024