小编Nig*_*ruz的帖子

即使将公共 ssh 密钥添加到 Git Hub 后,也无法将更改从本地系统推送到源系统

我有一个新系统(MacBook Pro),想要对其进行设置,以便它可以直接推送到我在 GitHub 上的远程存储库。我遵循的步骤是:

  1. 使用命令生成 ssh 密钥ssh-keygen -t rsa
  2. 将内容复制id_rsa.pub到我的 Github 帐户的 SSH 密钥区域。
  3. 在 GitHub 上创建了一个存储库。
  4. 使用 . 将存储库 URL (https) 复制到我现有的本地项目中git remote set-url origin https://github.com/username/repo.git
  5. 使用拉动git pull origin master(没有错误)。
  6. 在使用推送新更改时,git push origin master我收到以下错误。
remote: Permission to UserName/repo-name.git denied to name.
fatal: unable to access 'https://github.com/UserName/repo-name.git/': The requested URL returned error: 403
Run Code Online (Sandbox Code Playgroud)

问题: 1. 为什么即使将 SSH 密钥添加到 Github 后,
我仍会收到权限被拒绝的错误?添加 SSH 密钥后,GitHub 不应该将我的系统视为可信设备吗?
2. 如何将我的系统添加为受信任设备,以免出现权限被拒绝的 …

git ssh github

2
推荐指数
1
解决办法
3074
查看次数

标签 统计

git ×1

github ×1

ssh ×1