Git推送到远程分支出错

执行git push -u origin master

fatal: '[email protected]:qilinonline/git_test.git' does not appear to be a git repository fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists.

原因:使用地址不对,这里采用了ssh地址,但是你没有添加ssh秘钥,所以无法连接远程仓库

解决办法:

1.使用https地址

2.添加ssh秘钥

1:生成秘钥:ssh-keygen -t rsa -C "你自己的邮箱"

(这里不要设置密码,直接按回车就可以,以后更新就不需要密码)

2: id_rsa 这个文件是你的私钥、id_rsa.pub是你的公共秘钥,用记事本打开文件id_rsa.pub,把里面的内容复制到github配置ssh

3:添加私秘钥到ssh: ssh-add id_rsa(如果添加失败可以先执行命令ssh-agent bash,然后再次添加私秘钥。)

4: 用ssh -T [email protected] 判断是否绑定成功。如果返回successfully 表示成功

具体教程看我上一章。

猜你喜欢

转载自www.cnblogs.com/zwdeblog/p/9725069.html
今日推荐