Shr*_*hav 237 git github token git-pull github-api
我使用用户名密码来推送我的代码,它已经工作了几个月,但突然间我无法做到并收到此错误:
Username for 'https://github.com': shreyas-jadhav
Password for 'https://shreyas-jadhav@github.com':
remote: Password authentication is temporarily disabled as part of a brownout. Please use a personal access token instead.
remote: Please see https://github.blog/2020-07-30-token-authentication-requirements-for-api-and-git-operations/ for more information.
Run Code Online (Sandbox Code Playgroud)
请注意,该链接没有帮助。即使使用生成的令牌也无济于事。
主持人注意:这是GitHub 计划中且即将进行的永久性服务更改的一部分
Kus*_*tha 162
git remote set-url origin https://<token>@github.com/<git_url>git pull https://<token>@<git_url>.git你很高兴去。
Nag*_*ram 137
编辑
以前接受的答案 /sf/answers/4773476991/ 可以 完成这项工作,但它不安全,因为我们以纯文本形式存储令牌。
在我的诚实看来,将它存储在钥匙串中是更好的方法。
对于 Visual Studio Code,请阅读此答案:https : //stackoverflow.com/a/68192584/7942242
你可以试试下面的@Venryx 评论,但我还没有测试过。
我现在才遇到这个问题
然后我在我的 Mac 中访问了我的钥匙链
我删除了(所有)GitHub 的行
现在我去了终端并推送了一个虚拟代码
git push
Run Code Online (Sandbox Code Playgroud)
终端要求我输入帐户的电子邮件和密码。
我输入了我的电子邮件,对于密码,我输入了我之前生成的令牌。
它又开始工作了。
dPa*_*Pac 28
Github-> Settings-> Developer settings-> Personal access tokens。重新生成您的令牌并复制它。git push,输入您的用户名,密码是生成的令牌您可以使用 Git 客户端缓存您的令牌,而不是为每个 HTTPS Git 操作手动输入您的令牌。
# Set git to use the credential memory cache
$ git config --global credential.helper cache
Run Code Online (Sandbox Code Playgroud)
# Set the cache to timeout after 1 hour (setting is in seconds)
$ git config --global credential.helper 'cache --timeout=3600'
Run Code Online (Sandbox Code Playgroud)
Avn*_*wal 20
密码验证已被 GitHub 禁用,不再受支持。创建并使用个人访问令牌而不是密码。
要遵循的步骤:
git fetch(或者git push,如果获取不需要权限)
如果在 Windows 上,您必须从 Powershell 运行它,而不是命令提示符。
remote: Password authentication is temporarily disabled尽管输入相同,但命令提示符始终失败并显示消息。
如果它没有询问您的用户名和密码,您必须更改您的 git remote url 以包含您的用户名:(
https://USERNAME@github.com/repo-owner/repo-name.git有关更改远程 url 的说明,请参阅方法 2)
或第二种方法:
git remote set-url origin https://<token>@<git_url>.gitgit pull https://<token>@<git_url>.gitcrg*_*g63 18
删除现有的存储库(如果您有任何当前更改,请备份它)mv my-repo my-repo.backup
创建一个 SSH 密钥并将其添加到 GitHub(请参阅GitHub 文档)
克隆 SSH 的 repo git clone git@github.com:group/repo-name.git
git远程删除原点
您必须添加访问令牌(请参阅GitHub 文档以生成令牌)
git remote add origin https://<token>@<git_url>.git
git pull https://<token>@<git_url>.git
git credential-osxkeychain erase
? host=github.com
? protocol=https
Run Code Online (Sandbox Code Playgroud)
git push或者git pull
它会提示您模态单击“允许”并按照该过程进行操作。小智 14
首先请删除钥匙串中的所有 github 凭据,然后由于 github 安全策略 Github --> 设置 --> 开发人员设置 --> 个人访问令牌,请生成您的令牌以用作密码
尝试在你的 repo 上推送或拉取最新的东西,然后 git 会询问你的用户名和密码,输入你的用户名和你从 github 生成的令牌
E J*_*rod 10
如果您使用 https
如果存储库已存在,则必须以以下格式更改远程 URL: https://<username>:<token>@github.com/<repository_url>
git remote remove origin
git remote add origin https://<USERNAME>:<TOKEN>@<GIT_URL>.git
git pull # verify
Run Code Online (Sandbox Code Playgroud)
git clone https://<USERNAME>:<TOKEN>@<GIT_URL>.git
Run Code Online (Sandbox Code Playgroud)
Sai*_*jee 10
尝试了所有方法,最后,它对我有用,由于此错误,我无法推送我的 repo,所以请至少尝试一次!
_____________________________生成个人访问令牌:
现在只需使用 PAT 而不是密码和用户名的帮助来推送它__________________
2 将更改推送到您的存储库:
git push https://[Personal Access Token]@github.com/[User Name]/[Repository Name].git
Run Code Online (Sandbox Code Playgroud)
我受了很多苦,希望能帮到你!
小智 7
在你的 vs 代码命令行上..
git config --global credential.helper [YOUR_TOKEN]
Ubuntu Server 现有git的解决方案
删除密码:
git config --global --unset user.password;
git config --local --unset user.password;
Run Code Online (Sandbox Code Playgroud)
更改 remote.origin.url 替换为您的 github 用户名:
git config --global --replace-all remote.origin.url "https://<username>@github.com/PPEProjects/smile-eyes-be.git";
git config --local --replace-all remote.origin.url "https://<username>@github.com/PPEProjects/smile-eyes-be.git"
Run Code Online (Sandbox Code Playgroud)
拉/推
git pull
git push origin HEAD:develop
Run Code Online (Sandbox Code Playgroud)
输入从这里生成的个人访问令牌:
https://github.com/settings/tokens
| 归档时间: |
|
| 查看次数: |
95253 次 |
| 最近记录: |