macbook 配置github

本文指导您如何在Macbook Pro上配置GitHub,包括安装客户端、生成SSH密钥、添加到SSH代理、添加公钥到账户及测试连接。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

      mbp配置github,在网上找了几个都是复制来复制去,不行,自己还是去看官方文档。

1、安装客户端(https://mac.github.com/),这里跟其他系统的区别是安装了没有.ssh文件。所以要生成这个文件。输入命令

ssh-keygen -t rsa -C "your_email@example.com"
然后生成了.ssh文件。

2、添加新key到ssh-agent

# start the ssh-agent in the background
eval "$(ssh-agent -s)"
# Agent pid 59566
ssh-add ~/.ssh/id_rsa
3、添加sshkey到你的账户
pbcopy < ~/.ssh/id_rsa.pub(将你的公钥复制到剪贴板,然后在网站上添加到sshkey)
4、测试
输入:ssh -T git@github.com
你会看见警告:
The authenticity of host 'github.com (207.97.227.239)' can't be established.
# RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
# Are you sure you want to continue connecting (yes/no)?
然后输入yes,看见
Hi username! You've successfully authenticated, but GitHub does not
# provide shell access.
,这样就成功了!
官方链接:https://help.github.com/articles/generating-ssh-keys/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值