天天看点

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

原文:https://blog.csdn.net/lw545034502/article/details/90696872

  ( 提示:Warning: Permanently added 'gitee.com,120.55.226.24' (ECDSA) to the list of known hosts.是公钥出问题了,要先设置用户和邮箱再重新生成ssh公钥即可。)

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设置

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

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

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

        点击add ssh key,