How does gitee (code cloud) generate and add a public key

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
insert image description here
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

insert image description here

2.2 Gitee add public key

Open Code Cloud, move the mouse into the avatar, and click Settings.
insert image description here
Click the SSH public key, open the configuration page, and copy a lot of data just generated here.
insert image description here
After the addition is complete, it looks like this:
insert image description here

2.3 Download code verification

Find the code repository to download and click "Copy":
insert image description here

Enter "git clone" on the command line first, and then paste the command copied from the tamper to the command line:
insert image description here

Three, summary

This article mainly introduces how to add a public key on gitee for reference~

Guess you like

Origin blog.csdn.net/xuxu_123_/article/details/131342959