git创建SSH keys

git出现Please make sure you have the correct access rights and the repository exists,需要创建SSH keys。

步骤:

1、打开Git.bash进行命令行界面输入代码如下:

 

git config --global user.name "Your Name" # 配置user.name
git config --global user.email "your_email@example.com" # 配置user.email
git config --global credential.helper store # 永久保存密码

 

2、查看配置信息

$ git config --list # 查看配置信息列表

3、清除原先的SSH keys

首先进入C:\Users\Administrator\.ssh目录文件下,再清除里面的所有原文件

4、SSH Key的生成,在Git.bash命令行界面输入代码如下(一路回车)

ssh-keygen -t rsa -C "your_email@example.com" # 生成SSH Key

5、添加新的SSH keys

.首先进入C:\Users\Administrator\.ssh目录文件下,打开新生成的文件id_rsa.pub,复制里面全部的内容;
.然后进入GitHub账户主页,点击头像旁边的下拉框找到“Settings”选项进入后再点击“SSH and GPG keys”选项,最后在指定的位置输入复制的内容,进行添加新的SSH keys

SSH keys添加成功如下图:

https://blog.csdn.net/qq_40695970/article/details/122361527

 

posted @ 2024-01-24 21:02  酸牛奶  阅读(242)  评论(0编辑  收藏  举报