1.安装brew,这个可谓是mac的神器啊,之后直接使用brew安装gi即可
2.使用brew安装git brew install git
3.使用码云生成公钥
在这里插入图片描述
1.点击生成公钥这里,执行这段代码ssh-keygen -t rsa -C "xxxxx@xxxxx.com"
2.稍后终端显示
chenglingdeMBP:vue-test alene$ ssh-keygen -t rsa -C "1192374211@qq.com"
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/alene/.ssh/id_rsa): /Users/alene/.sh Created directory ‘/Users/alene/.ssh’.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /Users/alene/.ssh/id_rsa.
Your public key has been saved in /Users/alene/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:DYYUEVcrfVSXwSP7d26A5gQ03NGIipXLOBJA7OwG+vo 1192374211@qq.com
The key’s randomart image is:
±–[RSA 2048]----+
| oo. =+.+.oo=o.+|
| . … oo.=oo…= |
| o …=++o… o .|
|. o . +.++… . |
|.o . .S … … |
|. o + …o|
| o + oo|
| . . o|
|.oE . |
±—[SHA256]-----+

3.使用finder前往文件夹/用户/alene/.ssh/id_rsa打开内容,里面即公钥,粘贴到码云即可
或者直接控制台运行cat ~/.ssh/id_rsa.pub则打印出公钥

Logo

前往低代码交流专区

更多推荐