Github企业版-远程:密码身份验证不可用于Git操作

8ehkhllq  于 2023-02-18  发布在  Git
关注(0)|答案(9)|浏览(174)

我的git工作正常,然后除了下面的问题开始发生之外,没有做任何更改,我已经尝试在
credentials.helper
我已经研究了几乎所有我能找到的stackoverflow答案

remote: Password authentication is not available for Git operations.
remote: You must use a personal access token or SSH key.
remote: See https://github.ibm.com/settings/tokens or
'https://github.ibm.com/WBurney/Blockchain_SDO.git/': 
The requested URL returned error: 403

谢谢

cfh9epnr

cfh9epnr1#

如果您已经在GitHub企业帐户中注册了一个公共ssh密钥,那么您可以使用sshurl来回避这个问题

cd /path/to/repo
git remote set-url origin git@github.ibm.com:WBurney/Blockchain_SDO.git

然后,任何类似git push/git fetch/git pull/git ls-remote的命令都将使用git remote set-url设置的SSH URL。
但是关于你原来的问题,试着按照“Creating a personal access token for the command line“。
如果您使用的是Mac,则为update your credentials from the OSX Keychain
您可能需要remove an old cached credential first
(As由RayLoveless评论)

6mw9ycah

6mw9ycah2#

另一个对我有效的解决方案是通过Windows凭据管理器更改凭据
1)清除缓存的凭据(谢谢@Rayloveless)。
2)按照this link中的步骤创建访问令牌。

  • 在任何页面的右上角,点按您的个人资料照片。
  • 单击设置
  • 在左侧栏中,单击开发人员设置
  • 个人访问令牌
  • 生成新令牌

3)进入"Windows凭据管理器"并查找您的Github企业帐户。
4)单击修改并使用生成的令牌替换密码。

xqkwcwgp

xqkwcwgp3#

试一下低于1-

git clone https://<user-name>:<git-token>@<github-path.git>
r1wp621o

r1wp621o4#

您需要重置凭据。打开GIT CMD并键入以下命令

git credential reject

按回车键。光标将等待下一次输入。然后键入

protocol=https
host=git.example.com

将www.example.com替换git.example.com为您的链接。
按两次“enter”键,让git知道命令结束了。现在在git执行任何操作之前,你需要做两件事,因为它会先验证你的用户名和密码。
1.用户名-它会出现在您的标志下登录为。例如,这是我的。给予确切的用户名-

1.密码-

  • 单击设置
  • 在左侧栏中,单击开发人员设置
  • 个人访问令牌
  • 生成新令牌(将此令牌复制到某处。它不会再次显示)

接下来,转到git cmd并执行git操作。例如-
git clone https://consulting-github.com/Rohan-Chikorde/example.git
一旦启动,它会提示输入用户名和密码。请给予用户名示例:Rohan-Chikorde和密码:e67682yourgeneratedtoken如上所述,你会很好地去。

pw136qt2

pw136qt25#

接受的答案将只适用于ssh,不适用于https。
该高速缓存重置命令似乎最近发生了变化。对我来说,这最终使它工作。

git credential reject
protocol=https
host=github.<YOUR_COMP>.com
3pvhb19x

3pvhb19x6#

对我来说,这是一个容易的过程去
1.生成我的token

  1. git remote remove origin
  2. git remote add origin https://<token>@<git_url>.git
    1.现在再次尝试命令(推,拉,..)。
r6hnlfcb

r6hnlfcb7#

对我来说,当我删除旧的生成令牌,生成新令牌并使用它时,它就起作用了

4nkexdtk

4nkexdtk8#

首先,您应该尝试生成个人访问令牌(PAT),然后将其作为GitHub的密码放入凭据管理器。进入凭据管理器〉Windows凭据〉GitHub(在通用凭据下)。现在把你的PAT作为密码。
如果你仍然不能克隆回购协议,然后尝试在Ajay这里的答案之一给出的方法,它为我工作过一次:git克隆https://<user-name>:<git-token>@<github-path.git>

6yjfywim

6yjfywim9#

git remote set-url origin git@github.ibm.com:WBurney/Blockchain_SDO.git

上面的git命令可以工作

相关问题