听峰问雨 听峰问雨
首页
导航站
  • 编程语言

    • Python
  • 数据结构与算法
  • 设计模式
  • UVA
  • LeetCode
  • 《Go语言实战》
  • 《Go Web编程》
  • 《算法精粹 经典计算机科学问题的Python实现》
  • 学习
  • 博客搭建
  • 本站

    • 分类
    • 标签
    • 归档
  • 我的

    • 收藏
    • 关于
GitHub (opens new window)

zfprotectors

默默学习er
首页
导航站
  • 编程语言

    • Python
  • 数据结构与算法
  • 设计模式
  • UVA
  • LeetCode
  • 《Go语言实战》
  • 《Go Web编程》
  • 《算法精粹 经典计算机科学问题的Python实现》
  • 学习
  • 博客搭建
  • 本站

    • 分类
    • 标签
    • 归档
  • 我的

    • 收藏
    • 关于
GitHub (opens new window)
  • GitHub

    • GitHub简介
    • Git配置
    • 问题解决

      • Git提交时提示“Please make sure you have the correct access rights and the repository exists.”的解决方法
      • Git无法push
      • Git提交规范
  • 应用程序层
  • GitHub
  • 问题解决
zfprotectors
2022-05-16

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

  1. 在需要提交的项目根目录下,输入以下命令来设置名字和邮箱:
git config --global user.name "你的名字"
git config --global user.email "你的邮箱"
1
2

该处填写的名字和邮箱为github上的用户名和邮箱

  1. 删除.ssh文件下的know_hosts
  2. 生成公钥认证所需的公钥和私钥文件
ssh-keygen -t rsa -C "你的名字/你的邮箱"
1

之后会出现以下内容:

Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/Administrator/.ssh/id_rsa):
/c/Users/Administrator/.ssh/id_rsa already exists.
Overwrite (y/n)? y(输入y)
Enter passphrase (empty for no passphrase):(回车)

Enter same passphrase again:(回车)

1
2
3
4
5
6
7
8

此时再.ssh文件夹下生成了两个文件,id_rsa和id_rsa.pub, 用文本编辑器打开id_rsa.pub, 将内容复制到下面

  1. 在Git中输入以下命令来检测是否与github连接成功:
ssh -T git@github.com
1
编辑 (opens new window)
#Mac#Git
上次更新: 2022/05/22, 23:59:38
Git配置
Git无法push

← Git配置 Git无法push→

最近更新
01
LeetCode88 - 合并两个有序数组
06-22
02
LeetCode1 - 两数之和
06-22
03
LeetCode1603 - 设计停车系统
06-21
更多文章>
Theme by Vdoing | Copyright © 2021-2022 zfprotectors | 闽ICP备2021014222号
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式