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

昨天晚上做了码云(Gitee)的教程,我就寻思着,要不把手上的一个项目也放上来?有一说一,冲冲冲!

刚开始的步骤都没问题,但是好像码云HTTPS上传有限制,项目里一个文件夹最小都有100M+,然后就给我了弹出了下图所示:

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

最后寻思了一下,既然HTTPS有限制,SSH呢?

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

git config –global user.name “yourname”

git config –global user.email“[email protected]

注:yourname是你要设置的名字,your@email是你要设置的邮箱。

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://gitee.com/profile/sshkeys

在key中将刚刚复制的粘贴进去,然后确定

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

5、在git中输入命令:

ssh -T [email protected]

然后会跳出一堆话。。

输入命令:yes

回车

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

原创文章,作者:陌涛,如若转载,请注明出处:https://imotao.com/2524.html

(0)
陌涛的头像陌涛
上一篇 2020年5月12日
下一篇 2020年5月12日

相关推荐

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据