一、git push origin master 时出错

错误信息为:
Permission denied(publickey).

fatal: Could not read from remote repository.

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

可能:

可能没联网

可能没配置好.git/conf文件

可能是与github上的账号没建立密钥对

二、解决办法

配置文件: 进入你的仓库,下面有个.git目录里面有conf配置文件,直接vim .git/conf
修改成如下:如果不是git提交是https方式,url和pushurl自己改成自己仓库的地址就好

 11
12 [remote "origin"]
13 url = git@github.com:s--enten--/--an.git
14 fetch = +refs/heads/*:refs/remotes/origin/*
15 pushurl = git@github.com:s--enten--/--an.git.git
16 [branch "master"]
17 remote = origin
18 merge = refs/heads/master

建立密钥:

  1. ssh-keygen -t rsa -C "youremail@example.com"

    注意,上述youremail@example.com是指github账户的注册邮箱

  2. ssh -v git@github.com

    上述命令执行后,出现的提示最后两句是

    No more authentication methods to try.

    Permission denied (publickey).

  3. ssh-agent -s

    上述命令执行后,出现的提示最后两句是

    SSH_AUTH_SOCK=/tmp/ssh-GTpABX1a05qH/agent.404; export SSH_AUTH_SOCK;

    SSH_AGENT_PID=13144; export SSH_AGENT_PID;

    echo Agent pid 13144;

  4. ssh-add ~/.ssh/id_rsa

    上述命令执行后,出现提示

    Identity added: . . . (这里是一些ssh key 文件路径)

    Could not open a connection to your authentication agent.

  5. 若第4步中出现上述提示,则执行此步骤,否则执行6

    eval 'ssh-agent -s'

    ssh-add ~/.ssh/id_rsa

  6. vim ~/.ssh/id_rsa.pub

    上述命令执行后id_rsa.pub文件内容将输出到终端,复制里面的密钥(内容一般是以ssh-rsa 开头,以github账号的注册邮箱结尾的,全部复制下来)

  7. 进入github账号,在settings下,选SSH and GPG keys, 点击new SSH key

    以下可参考这篇博客

Git push提交时报错Permission denied(publickey)...Please make sure you have the correct access rights and the repository exists.的更多相关文章

  1. git pull 出错 fatal: Could not read from remote repository.Please make sure you have the correct access rights.and the repository exists.

    Warning: Permanently added the RSA host key for IP address '192.30.252.131' to the list of known hos ...

  2. git遇到的问题之“Please make sure you have the correct access rights and the repository exists.”

    对于git的提交一直很小心翼翼,感觉一不小心就会踩到莫名的坑. 这不, 某天commit 就遇到了On branch master nothing to commit (working directo ...

  3. 【Devops】【docker】【CI/CD】jenkins源码管理,添加SSH地址后报错+Jenkins构建报错:Please make sure you have the correct access rights and the repository exists.

    jenkins源码管理,添加SSH地址后报错: Could not read from remote repository. Please make sure you have the correct ...

  4. windows 部署 git 服务器报 Please make sure you have the correct access rights and the repository exists.错误

    这两天在阿里云上弄windows 服务器,顺便部署了一个git服务.根据网上教程一步步操作下来,最后在 remote远程仓库的时候提示 fatal: 'yourpath/test.git' does ...

  5. 【Devops】【docker】【CI/CD】Jenkins源码管理,设置gitlab上项目的clone地址 + jenkins构建报错:Please make sure you have the correct access rights and the repository exists.

    注意,如果 jenkins构建报错:Please make sure you have the correct access rights and the repository exists. 而此时 ...

  6. 使用git时出现Please make sure you have the correct access rights and the repository exists.问题已解决。

    使用git时,出现Please make sure you have the correct access rights and the repository exists.问题已解决. 今天我在使用 ...

  7. [Git]Please make sure you have the correct access rights and the repository exists

    这个问题是这样,需要在已有github账号的A机器上,再创建一个github账号,新账号创建完毕,将代码通过机器A push上之后,再另一台机器B,clone 这个项目时报出了如下错误: Permis ...

  8. git提交时报错 permission denied

    git push 时报错:permission denied xxx 目前很多解决办法是生成公钥和秘钥,这种方法安全可靠,比较适用于一台电脑对应一个git账户,但是多个账户在同一台电脑上提交使用git ...

  9. 报错 Please make sure you have the correct access rights and the repository exists (git 添加ssh密钥 )

    1.设置Git的user name和email $ git config --global user.name "wubaiwan" $ git config --global u ...

随机推荐

  1. Windows Server 2016-管理Active Directory复制任务

    Repadmin.exe可帮助管理员诊断运行Microsoft Windows操作系统的域控制器之间的Active Directory复制问题. Repadmin.exe内置于Windows Serv ...

  2. 浏览器本地数据存储解决方案以及cookie的坑

    本地数据存储解决方案以及cookie的坑 问题: cookie过长导致页面打开失败 背景: 在公司的项目中有一个需求是打开多个工单即在同一个页面中打开了多个tab(iframe),但是需要在刷新时只刷 ...

  3. 数据执行保护呈灰色无法开启 用命令BCEDIT无效 请问怎么解决?

    1.默认的管理员账号是关闭开不了的. 2.你重新创建个管理员账户. 3.然后登陆这个账号. 4.然后打开cmd 输入 bcdedit /set nx optin alwaysoff 这行指令.然后回车 ...

  4. 持续集成-Jenkins安装部署

    1. 安装JDK[java8] 1.1. 软件安装 [yun@mini05 software]# pwd /app/software [yun@mini05 software]# .0_112.tar ...

  5. LeetCode算法题-Add Binary(Java实现)

    这是悦乐书的第157次更新,第159篇原创 01 看题和准备 今天介绍的是LeetCode算法题中Easy级别的第16题(顺位题号是67).给定两个二进制字符串,返回它们的总和(也是二进制字符串).输 ...

  6. 【算法】LeetCode算法题-Merge Two Sorted List

    这是悦乐书的第148次更新,第150篇原创 01 看题和准备 今天介绍的是LeetCode算法题中Easy级别的第7题(顺位题号是21).合并两个已排序的链表并将其作为新链表返回. 新链表应该通过拼接 ...

  7. js判断手机系统

    var u = navigator.userAgent; var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > - ...

  8. ID 生成器

    using System; using System.Diagnostics; using System.Net; using System.Net.Sockets; using System.Thr ...

  9. 03.Python网络爬虫第一弹《Python网络爬虫相关基础概念》

    爬虫介绍 引入 之前在授课过程中,好多同学都问过我这样的一个问题:为什么要学习爬虫,学习爬虫能够为我们以后的发展带来那些好处?其实学习爬虫的原因和为我们以后发展带来的好处都是显而易见的,无论是从实际的 ...

  10. 设计模式のObserver Pattern(观察者模式)----行为模式

    一.问题产生背景 又被称为订阅发布模式. 最初流传最广的一个面试题:有一只猫咪,猫咪叫了一声,老鼠跑了,老人惊醒了,男主人骂,小偷吓得不敢动了....这就产生一个问题的模型,当对象间存在一对多关系时, ...