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

对于git的提交一直很小心翼翼,感觉一不小心就会踩到莫名的坑。

这不,

某天commit 就遇到了On branch master nothing
to commit (working directory clean)

一查意思。你的分支很干净?

干净?excuse me?

然后git push origin master一下,漫长等待了弹出了fail:#¥%@(此处省略,我们看重点)

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

然后谷歌了一下,原来是ssh key有问题,连接不上服务器~~

然后我开始了死胡同~~

参阅了很多的答案,发现写的都不是很完整,自己东摸索西摸索搞定了,怕忘记,记录一下

1、首先我得重新在git设置一下身份的名字和邮箱(因为当初都忘了设置啥了,因为遇到坑了)进入到需要提交的文件夹底下(因为直接打开git Bash,在没有路径的情况下,根本没!法!改!刚使用git时遇到的坑。。。)

git config --global user.name "yourname"

git config --global user.email“[email protected]"

注:yourname是你要设置的名字,[email protected]是你要设置的邮箱。

2、删除.ssh文件夹(直接搜索该文件夹)下的known_hosts(手动删除即可,不需要git)

3、git输入命令

$ ssh-keygen -t rsa -C "[email protected]"(请填你设置的邮箱地址)

接着出现:

Generating public/private rsa key pair.

Enter file in which to save the key (/Users/your_user_directory/.ssh/id_rsa):

请直接按下回车

然后系统会自动在.ssh文件夹下生成两个文件,id_rsa和id_rsa.pub,用记事本打开id_rsa.pub

将全部的内容复制

4、打开https://github.com/,登陆你的账户,进入设置

进入ssh设置

在key中将刚刚复制的粘贴进去

点击add ssh key,

ok!

5、在git中输入命令:

ssh -T [email protected]

然后会跳出一堆话。。

输入命令:yes

回车

然后就会提示你成功了~~

泪牛满面~~

最后退出git重新进入路径提交一下就可以了~~

转载----https://blog.csdn.net/jingtingfengguo/article/details/51892864

原文地址:https://www.cnblogs.com/duende99/p/9545216.html

时间: 2024-10-03 19:16:17

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.”

对于git的提交一直很小心翼翼,感觉一不小心就会踩到莫名的坑. 这不, 某天commit 就遇到了On branch master nothing to commit (working directory clean) 一查意思.你的分支很干净? 干净?excuse me? 然后git push origin master一下,漫长等待了弹出了fail:#¥%@(此处省略,我们看重点) Please make sure you have the correct access rights and

git clone的时候遇到“Please make sure you have the correct access rights and the repository exists”

1.搜索.ssh文件,删除该文件下的known_hosts文件 2.运行Git Bash,输入命令ssh-keygen -t rsa -C "username",然后一路回车 3.在.ssh文件夹里找到 id_rsa.pub文件,打开,全部复制,然后登录 https://github.com/,找到settings,配置 SSH keys 将之前复制的id_rsa.pub文件里的所有内容黏贴在下面 4.最后运行Git Bash,输入命令ssh -T [email protected]

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

这两天在阿里云上弄windows 服务器,顺便部署了一个git服务.根据网上教程一步步操作下来,最后在 remote远程仓库的时候提示 fatal: 'yourpath/test.git' does not appear to be a git repositoryfatal: Could not read from remote repository. Please make sure you have the correct access rightsand the repository e

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 hosts. Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repositor

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

这个问题是这样,需要在已有github账号的A机器上,再创建一个github账号,新账号创建完毕,将代码通过机器A push上之后,再另一台机器B,clone 这个项目时报出了如下错误: Permission denied (publickey).fatal: Could not read from remote repository. 解决方式是: 在clone代码的时候要使用https的形式. https://github.com/accountName/projectname.git 另外

Git提交时提示“Please make sure you have the correct access rights and the repository exists.”的解决方法

1.首先打开Git Bash设置名字和邮箱: git config --global user.name "你的名字" git config --global user.email“你的邮箱" 2.删除.SSH文件下的known_hosts(.SSH在C:\Users\Windows用户名目录下) 3.生成ssh公钥认证所需的公钥和私钥文件 ssh-keygen -t rsa -C "你的名字/你的邮箱" 然后会出现以下内容 Generating publ

git "Could not read from remote repository.Please make sure you have the correct access rights."解决方案

我们在使用git clone 或其他命令的时候,有时候会遇到这类问题,如图: fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. fatal: Could not read from remote repository.Please make sure you have the correct acc

git Problem with the SSL CA cert (path? access rights?)

问题: [[email protected] opt]# git clone https://github.com/docker/docker.git 正克隆到 'docker'...fatal: unable to access 'https://github.com/docker/docker.git/': Problem with the SSL CA cert (path? access rights?) 解决方法: 1,查看是否存在ca-bundle.crt, [[email prot

git 查看远程分支、本地分支、创建分支、把分支推到远程repository、删除本地分支

git 查看远程分支.本地分支.创建分支.把分支推到远程repository.删除本地分支 [plain] view plain copy $ git branch -a * br-2.1.2.2 master remotes/origin/HEAD -> origin/master remotes/origin/br-2.1.2.1 remotes/origin/br-2.1.2.2 remotes/origin/br-2.1.3 remotes/origin/master 2 查看本地分支