一、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 chocolatey 修改默认安装软件默认安装路径

    管网解释 https://chocolatey.org/docs/features-install-directory-override 1.--install-directory=value    ...

  2. gif软件(ShareX)

    介绍 官网:https://getsharex.com/ 开源,免费的一款软件,录制GIF功能简单,按下快捷键,选取指定的区域即可进行录制,录制完成后的文件默认存放在个人文件夹,整个过程几乎几打断你的 ...

  3. LeetCode算法题-Add Digits(Java实现-3种解法)

    这是悦乐书的第199次更新,第207篇原创 01 看题和准备 今天介绍的是LeetCode算法题中Easy级别的第63题(顺位题号是258).给定非负整数num,重复添加其所有数字,直到结果只有一位数 ...

  4. Python Numpy-基础教程

    目录 1. 为什么要学习numpy? 2. Numpy基本用法 2.1. 创建np.ndarry 2.2. Indexing and Slicing Boolean Index 2.3. Univer ...

  5. Linux中的文件查找技巧

    前言 Linux常用命令中,有些命令可以帮助我们查找二进制文件,帮助手册或源文件的位置,也有的命令可以帮助我们查找磁盘上的任意文件,今天我们就来看看这些命令如何使用. witch witch命令会在P ...

  6. 【PS技巧】如何拼图

    1.材料准备 根据对图片的内容表达,粗略的“计划”,每张图片摆放位置及尺寸.C与D等高,C/D与B叠高后与A等高.C与D叠宽后与B等宽. 2.记录每张图片原始大小 (1)双击工作区,打开待拼接图片 ( ...

  7. deeplearn.js

    http://blog.csdn.net/rongxiang111/article/details/78083867 <!DOCTYPE html> <html> <he ...

  8. linux学习笔记整理(九)

    第十章 Centos7-系统进程管理本节所讲内容:10.1 进程概述和ps查看进程工具10.2 uptime查看系统负载-top动态管理进程10.3 前后台进程切换- nice进程优先级-实战scre ...

  9. P2678 跳石头题解

    #include<cstdio> #include<iostream> #include<algorithm> #include<cstring> #i ...

  10. HTTP协议、HTTP请求方法、常见状态码、HTTP消息

    HTTP协议 客户端请求,服务端响应.浏览器与服务器不建立持久连接,响应后连接失效. HTTP请求方法 一.GET GET方法用于获取请求页面的指定信息. 二.HEAD 除了服务器不能在响应里返回消息 ...