Github 企业 - 远程:Git 操作无法使用密码认证

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/45903106/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 05:06:51  来源:igfitidea点击:

Github enterprise - remote: Password authentication is not available for Git operations

gitgithubgithub-enterprise

提问by Muhammad Raafay Khan

My git was working fine, then without changing anything than the following problem started to happen, I have tried resetting the cache in

我的 git 工作正常,然后没有改变任何东西,但开始发生以下问题,我尝试重置缓存

credentials.helper

凭据.helper

and have gone through pretty much every stackoverflow answer I could find

并且已经完成了我能找到的几乎所有 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

Thanks

谢谢

回答by VonC

If you have registered a public ssh key to your GitHib enterprise account, you could side-step the issue using an ssh url

如果您已将公共 ssh 密钥注册到您的 GitHib 企业帐户,则可以使用 ssh url 回避该问题

cd /path/to/repo
git remote set-url origin [email protected]:WBurney/Blockchain_SDO.git
git push

But regarding your original issue, try and follow "Creating a personal access token for the command line".

但是关于您的原始问题,请尝试遵循“为命令行创建个人访问令牌”。

If you are on Mac, update your credentials from the OSX Keychain.

如果您使用的是 Mac,请从 OSX Keychain 更新您的凭据

You might need to remove an old cached credential first.
(As commentedby RayLoveless)

您可能需要先删除旧的缓存凭据
(正如RayLoveless评论那样

回答by Omar Yaya

Another solution that worked for me was changing the credentials via the Windows Credentials Manager:

另一个对我有用的解决方案是通过 Windows Credentials Manager 更改凭据

1) Clear your cached credentials (thanks @Rayloveless).

1)清除缓存的凭据(感谢@ Rayloveless)。

2) Follow the steps in this linkto create an access token.

2) 按照此链接中的步骤创建访问令牌。

  • In the upper-right corner of any page, click your profile photo.
  • Click Settings
  • In the left sidebar, click Developer settings
  • Personal access tokens
  • Generate new Token
  • 在任何页面的右上角,单击您的个人资料照片。
  • 单击设置
  • 在左侧边栏中,单击开发人员设置
  • 个人访问令牌
  • 生成新令牌

3) Go to "Windows Credential Manager" and look for your Github Enterprise account.

3) 转到“Windows Credential Manager”并查找您的 Github Enterprise 帐户。

4) Click modify and replace the password with the token you generated.

4) 单击修改并用您生成的令牌替换密码。

回答by Ajay Kumar

Try below one -

尝试以下之一 -

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

回答by Atul Soman

The accepted answer will work only for ssh, not for https.

接受的答案仅适用于 ssh,不适用于 https。

The cache reset commends seems to have recently changed. For me that eventually made it work.

缓存重置命令似乎最近发生了变化。对我来说,这最终使它起作用。

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

回答by Monalisa Das

For me it worked when I deleted the old generated token and generated new one and used that

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

回答by Jayaprakash Nagabhirava

git remote set-url origin [email protected]:WBurney/Blockchain_SDO.git

The above git command will works

上面的 git 命令将起作用