shu*_*dav 14 git github git-clone personal-access-token private-repository
尝试连接 GitHub 时出错:
remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.
remote: Please see https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information.
fatal: unable to access 'https://github.com/ershubhamyadav/dream365web.git/': The requested URL returned error: 403
Run Code Online (Sandbox Code Playgroud)
shu*_*dav 25
请按照以下简单步骤获取解决方案。
Gil*_*tal 17
https://<access token>@github.com/userName/repo.git如果在詹金斯上,请将凭据设置为无。
小智 14
首先生成令牌,因为 Github 在对 Git 操作进行身份验证时不再接受帐户密码,并要求从 2021 年 8 月 13 日开始使用基于令牌的身份验证。
如何生成令牌 转到设置,然后进入开发人员设置 ,然后选择个人访问令牌(第三个选项)单击右上角的“生成新令牌”按钮输入注释,选择到期日期,然后检查范围选项并单击底部的生成按钮。复制生成的令牌。这就是我们将用下面第二条指令中的令牌替换的内容。
git remote add origin https://github.com/username/directory-name.git
git remote set-url origin https://<token>@github.com/username/directory-name.git
git branch -M main
git push -u origin main
Run Code Online (Sandbox Code Playgroud)
这可以解决您的问题
小智 5
当我尝试将本地目录中的项目推送到 GitHub 目录时,我遇到了同样的问题,然后尝试按照以下步骤操作:
| 归档时间: |
|
| 查看次数: |
63359 次 |
| 最近记录: |