1. Introduction
When using Gitee, the public key is required, whether it is cloning or uploading. This article mainly introduces how to generate and add a public key locally to the server. for reference.
Two, step introduction
2.1 Generate public key locally
Open git bash
and enter the following code and press Enter three times:
# 替换为你自己的邮箱即可
ssh-keygen -t rsa -C "[email protected]"
Enter the following code to view your public key (public key):
cat ~/.ssh/id_rsa.pub
2.2 Gitee add public key
Open Code Cloud, move the mouse into the avatar, and click Settings.
Click the SSH public key, open the configuration page, and copy a lot of data just generated here.
After the addition is complete, it looks like this:
2.3 Download code verification
Find the code repository to download and click "Copy":
Enter "git clone" on the command line first, and then paste the command copied from the tamper to the command line:
Three, summary
This article mainly introduces how to add a public key on gitee for reference~