How gitee (code cloud) generates and adds public keys, and configures user information

1. Introduction
When using Gitee, the public key is necessary, whether cloning or uploading. This article mainly introduces how to generate and add public keys to the server locally, and then configure your own user information to facilitate pulling and uploading codes in the future.

2. Step introduction
2.1 Generate public key locally
. Open git bash, enter: ssh-keygen -t rsa -C "your email", and then press Enter three times. Insert image description here
Enter the (cat ~/.ssh/id_rsa.pub) code to view your public key (see picture above)

2.2 Gitee adds public key
Insert image description here

Insert image description here
Insert image description here

2.3 Configure user email and user name

git config --global user.email [email]   //邮箱
git config --global user.name [username] //密码

Insert image description here
Check whether the configuration is successful.
Insert image description here
The appearance of user.email and user.name indicates that the configuration is successful.

Guess you like

Origin blog.csdn.net/qq_17355709/article/details/132245093