mac安装git以及生成公钥

1.安装brew,这个可谓是mac的神器啊,之后直接使用brew安装gi即可
2.使用brew安装git brew install git
3.使用码云生成公钥
mac安装git以及生成公钥
1.点击生成公钥这里,执行这段代码ssh-****** -t rsa -C "[email protected]"
2.稍后终端显示
chenglingdeMBP:vue-test alene$ ssh-****** -t rsa -C "[email protected]"
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 [email protected]
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则打印出公钥