GitHub--重装系统后关联以前的GitHub

 

昨天重装了系统今天git push的时候发现了这个问题,原因是本地仓库和远程的SSH不匹配

解决办法:

1.出现Are you sure you want to continue connecting (yes/no)?时,选择yes

2. ls -al ~/.ssh

3. ssh-keygen -t rsa -C "github用户名",按三次回车

4.cat ~/.ssh/id_rsa.pub生成新的SSH

5.登陆github,点击头像-settings-new SSH,复制新生成的SSH

6.在目前目录下用ssh -T [email protected]验证。

7.正常push

猜你喜欢

转载自blog.csdn.net/qq_31741481/article/details/88557955