Basic knowledge
Software Testing | Git Operations for Program Apes (2)
Git Create Warehouse Upload Code Related Operations
In the previous article, we talked about how to configure the Git environment and register a Gitee account. In this article, we will explain the operation of Fork and Clone projects.
Fork Project
There are also some excellent open source projects on Gitee, and we want to obtain project resources. The Fork function can meet our needs and directly obtain projects from others. As shown in the following figure, we click on the Fork button in the upper right corner
Select the target space in the pop-up window, and then click OK to proceed with Fork
After Fork is completed, it will automatically jump to our project
In this way, we have completed the Fork operation.
Clone/Download Project
When we see a project that we are particularly interested in online, such as the recently popular ChatGPT, and want to build our own local environment, how can we obtain this code locally after finding such an open source project?
We have two ways to obtain code locally: cloning and downloading.
Download Code
We can directly download the zip package of the project to the local location, and then extract it.
Clone Code
In addition to downloading, we can also clone the code locally. We can save the project in our daily directory, open the command-line tool, copy the clone command, and press Enter to run it.
HTTPS cloning
Git clone HTTPS link
Copy the HTTPS clone link for cloning, as shown in the following figure:
This completes the HTTPS method of cloning.
SSH cloning
Similar to HTTPS cloning, we can copy the SSH link by running the command on the command line
Git clone SSH link
We can choose another project for cloning, as shown in the following figure:
In this way, we have completed the SSH method of cloning.
We can check the folder to see if there are two projects we just cloned and confirm if they were successfully cloned.
As shown in the above figure, we can confirm that we have successfully cloned the two projects mentioned above.
summary
Forking and cloning are both very simple operations that are often used in our daily work. We hope everyone remembers that we will share the operation of pulling code to create a warehouse in the future. Stay tuned!