本地新建GitHub远程仓库SSH连接,git init 及 clone的操作记录

背景

公司电脑更换,本人原来在Github上的代码需要继续使用Git来维护,以下内容为我操作时的记录20180207,方便自己学习,同时也希望为其他有同样问题的朋友提供一点思路。

说明

## 表示注释说明
必要的终端命令已经用颜色标记

重新新建ssh连接

## 打开终端 尝试连接git

localhost% ssh -T git@github.com
The authenticity of host 'github.com (192.30.255.112)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'github.com,192.30.255.112' (RSA) to the list of known hosts.
git@github.com: Permission denied (publickey).

## 首先,清除现电脑中所有的key-pair
ssh-add -D
rm -r ~/.ssh

## 删除你在github中的public-key
## 在浏览器中登录github --> settings --> SSH and GPG keys 中删除原来的 

## 新建ssh-key 一般用你原先的邮箱账号
localhost% ssh-keygen -t rsa -C "zh75701@aidong.com"

## 连续3次enter键可以不要密码
Generating public/private rsa key pair.
Enter
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值