使用git连接到Github

直奔主题,使用git连接到Github步骤如下:

1. 安装git

yum install git

或者

sudo get-apt install git git-core

2. 全局配置

git config --global user.name "furzoom"
git config --global user.email "mn@furzoom.com"

3. 生成密钥

ssh-keygen -t rsa -C "mn@furzoom.com"

有任何提示,直接回车即可。

4. 将公钥提交到Github

复制文件~/.ssh/id_rsa.pub中的内容到Github中。

vim ~/.ssh/id_rsa_pub

复制文件中的内容,打开https://github.com/settings/ssh,并点击Add SSH key,将内容粘贴到Key中。

5. 测试连接状态

$ ssh git@github.com
The authenticity of host 'github.com (192.30.252.129)' can't be established.
RSA key fingerprint is XXXXXXXXX.
Are you sure you want to continue connecting (yes/no)? yes 
Warning: Permanently added the RSA host key for IP address '192.30.252.128' to the list of known hosts.
PTY allocation request failed on channel 0
Hi Furzoom! You've successfully authenticated, but GitHub does not provide shell access.
                                                                                        Connection to github.com closed.
$ 

出现类似如下上信息表示连接成功了。剩下的操作就是正常的git操作了。

更多请参考枫竹梦

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

枫竹梦

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值