一、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. c/c++ 标准顺序容器 之 push_back,push_front,insert,emplace 操作

    c/c++ 标准顺序容器 之 push_back,push_front,insert,emplace 操作 关键概念:向容器添加元素时,添加的是元素的拷贝,而不是对象本身.随后对容器中元素的任何改变都 ...

  2. UNIX高级环境编程(14)文件IO - O_DIRECT和O_SYNC详解 < 海棠花溪 >

    春天来了,除了工作学习,大家也要注意锻炼身体,多出去运动运动.  上周末在元大都遗址公园海棠花溪拍的海棠花.   进入正题. O_DIRECT和O_SYNC是系统调用open的flag参数.通过指定o ...

  3. GitLab安装及使用

    GitLab是一个利用 Ruby on Rails 开发的开源应用程序,实现一个自托管的Git项目仓库,可通过Web界面进行访问公开的或者私人项目. GitLab拥有与Github类似的功能,能够浏览 ...

  4. LeetCode算法题-Number of Boomerangs(Java实现)

    这是悦乐书的第231次更新,第244篇原创 01 看题和准备 今天介绍的是LeetCode算法题中Easy级别的第98题(顺位题号是447).给定平面中的n个点都是成对不同的,"回旋镖&qu ...

  5. Python语法基础-函数,类以及调试处理

    [TOC] 1. 函数的定义 python中函数有两种: python自带的函数 用户定义函数 返回多个值 原来返回值是一个tuple!但是,在语法上,返回一个tuple可以省略括号,而多个变量可以同 ...

  6. 服务创建&删除

    创建服务.bat @echo.服务启动...... @echo off @sc create BestoneProductEditSvc binPath= "D:\winSvc\Beston ...

  7. 【Teradata】四舍五入函数

    1.round函数(四舍五入) (1)dbscontrol设定使用普通四舍五入方式 //使用root用户登录数据库节点 dbscontrol display general . RoundHalfwa ...

  8. (5)Python字典

  9. 为了下载和使用最新的git,只好安装了迅雷

    一  安装迅雷时总感觉它的图标像是灰鸽子,让人不放心. 从https://git-scm.com/downloads上找到64-bit Git for Windows Setup的地址: https: ...

  10. [tool] google搜索的正确使用姿势(待补全)

    第一,也是非常重要的前提,请一定要能FQ.如果这条没有解决,没有往下的必要 现在我假设你已经能FQ了,个人推荐使用搜索引擎的顺序: Google>微软bing国际搜索>百度 (百度总能给你 ...