Git推送到远程分支出错


执行git push -u origin master

fatal: 'git@github.com: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 git@github.com 判断是否绑定成功。如果返回successfully 表示成功

具体教程看我上一章。


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM