推送不起作用错误

推送不起作用错误

本文介绍了Git 推送不起作用错误“您必须使用个人访问令牌或 SSH 密钥"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Git 抛出错误

"C:\Program Files (x86)\Git\bin\git.exe" push -u --recurse-submodules=check -
-progress "origin" refs/heads/dev_civaplugin:refs/heads/dev_civaplugin
remote: Password authentication is not available for Git operations.
remote: You must use a personal access token or SSH key.
remote: See https://github.build.ge.com/settings/tokens or
https://github.build.ge.com/settings/ssh
fatal: unable to access
'https://github.build.ge.com/108012572/NextGenUT.git/': The requested URL
returned error: 403
Done

 Press Enter or Esc to close console...

我使用 git extension 成功克隆了远程存储库,并且也能够创建新分支,但是当我尝试推送我的更改时,它会抛出上述错误.

I cloned remote repository successfully using git extention and able to create new branch also but when tried to push my changes its throwing above error.

我使用工具创建了公钥和私钥> putty> 生成或导入密钥我的电脑在用户中没有 > .SSH 文件夹在 git hub 中,我也使用 Settings > Developer settings > Personal access tokens 创建了 Personal access token不清楚问题是什么,任何输入都是一个很大的帮助

I created public and private key using Tools> putty> generate or import keymy pc don’t have > .SSH folder in userIn git hub I created Personal access token also using Settings > Developer settings > Personal access tokensNot getting clear idea of what the issue is, any input is a great help

推荐答案

直接转到第 6 步 [如果您有单点登录,请从第 1 步开始]

  1. 在您的本地机器上生成一个 SSH 密钥(在创建密钥时输入密码)
ssh-keygen -t rsa
  1. 复制以ssh-rsa
  2. 开头的私钥
  3. 转到 Github > 设置 > SSH 和 GPG 密钥
  4. 点击New SSH key并粘贴您之前复制的私有密钥,然后创建它
  1. Copy the private key which starts with ssh-rsa
  2. Go to Github > settings > SSH and GPG keys
  3. Click on New SSH key and paste the private that you've copied earlier, and create it
  1. 现在,启用 SSO 并授权您的组织
  1. 确保将新创建的 ssh 私钥添加到 SSH 身份验证代理中
ssh-add <your-private-key>
(e.g., ssh-add id_rsa)

注意:默认情况下,它只有您的 id_rsa 主键;因此,您需要在其中添加您的自定义私钥.

Note: By default, it will have your id_rsa primary key only; so, you need to add your custom private key in it.

这篇关于Git 推送不起作用错误“您必须使用个人访问令牌或 SSH 密钥"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-23 14:03