在Mac上使用SSH连接GitHub

在Mac上使用SSH连接GitHub

先打开终端

1.在Git中设置用户名:

git config --global user.name “你的名字”

例如:

git config --global user.name "clearlon"

查看是否设置成功,命令行中输入:

git config --global user.name

结果如下:
在这里插入图片描述

2.在Git中设置你的电子邮箱地址

例如,你的GitHub账号绑定的邮箱为:[email protected]

git config --global user.email "[email protected]"

查看是否设置成功,命令行中输入:

git config --global user.email

设置成功则显示邮箱账户:[email protected]

3.创建一个新的SSH密钥并添加到ssh-agent中

(1)打开终端
(2)复制下面的命令并运行,“ ”号内为你自己的邮箱。

ssh-k

你可能感兴趣的:(git,clone,SSH,Mac,ssh,git,github,mac,macos)