How to use gitee elegantly

1. Configuration

1. Register a code cloud account

gitee main interface
After registration, you can enter the gitee main interface.

2. Add ssh public key

(1) Call up the command line and enter the following code in the command line

ssh-keygen -t ed25519 -C "[email protected]"  

Note: "[email protected]" here is the main email when registering a gitee account. If you have not added an email, you need to add it.
Just enter all the way during the execution process.

(2) Add public key

Insert image description here
C:\Users\lihaopeng/.ssh/id_ed25519.pub. is the path to the generated file. Use Notepad to open this file and copy it.
Then open the ssh public key in gitee settings

Insert image description here
In the blank space of the public key, paste what you copied and click OK.
Insert image description here
This completes the addition of the public key.

2. Upload local projects to Code Cloud

1. Create a new warehouse

On the gitee homepage, click the plus sign to create a new warehouse.
Insert image description here
Note that the name of the warehouse must not have existed before, otherwise an error will occur.
Do not perform any operations after that. Just click the Create button. If there is a check mark by default, cancel it
Insert image description here
and click Next. The picture is similar to the interface, which means that there is no error at present.
I will mark the picture below as picture 1, because this picture will also be used below.
Insert image description here

2. Perform operations on the terminal

(1) Open the terminal

Copy the code in the first black box line by line, and
nothing pops up when Enter is executed, so there is no error in the code! ! !
Insert image description here

(2) If there is something to upload, perform this step

Press shift on the interface where you want to upload the file and right-click to enter the power shell window
Insert image description here
Insert image description here
to execute the initialization code: this step is very important

git init
git remote rm origin
git status
git add .
git commit -m "add files"

Be sure to execute them one by one. If a
Insert image description here
situation like the picture appears, it means there is no problem.

(3) Upload files

(2) All files have been selected.
(3) All files in the folder will be uploaded to the warehouse.
Execute the last two codes in the third black box in Figure 1.
They must be executed one by one.

git remote add origin [email protected]:lihaopeng123/li123.git
git push -u origin "master"

If the execution result looks like the one in the picture, it means there is no problem.

Insert image description here

(4) If you feel it is not safe, you can check it in gitee.

Insert image description here

You can see that the files in the folder have been transferred to the li123 warehouse normally. There is no big problem! ! !

The journey of learning is very difficult, don’t be impatient, take your time, the problem will always be solved, if there is something you don’t understand, you can leave a private message... I will reply if you see it! !

Guess you like

Origin blog.csdn.net/weixin_44463519/article/details/125431390