Kon*_*dal 6 git bitbucket git-pull pull-request atlassian-sourcetree
我在git中有多个帐户,我在三周前使用此帐户提交了代码。我将无法提取我的代码。我收到请求的URL返回错误:403我会尝试按Git返回错误代码403致命:HTTP请求失败, 但我无法解决我的错误
git -c diff.mnemonicprefix=false -c core.quotepath=false fetch origin
remote: Forbidden
fatal: unable to access
'https://chantidurgam@bitbucket.org/chantidurgam/patanjali.git/': The requested
URL returned error: 403
Run Code Online (Sandbox Code Playgroud)
完成但有错误,请参见上文。
Arm*_*min 16
在其他任何事情之前需要检查的是access level,它应该被设置为write。如果其他人将您添加到存储库,而他们忘记授予您所需的权限,则可能会发生这种情况。
Er.*_*sha 12
大家好,我收到密码身份验证的支持已于 2021 年 8 月 13 日删除。请改用个人访问令牌。远程:请参阅https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/了解更多信息。
问题逐步解决
现在我们对Git操作需要Token认证要求,因为Github出于安全目的对密码认证进行了更改。
您需要遵循一些内容才能生成个人访问令牌。
直接链接https://github.com/settings/tokens/new用于创建个人访问令牌
第 1 步 - 打开 GitHub 并使用您的凭据登录。
第 2 步 - 单击“设置”菜单。
步骤 3 - 在“设置”菜单中,单击“开发人员设置”,有两个选项可用于 OAuth 应用程序和个人访问令牌。
第 5 步 - 单击“生成新令牌”按钮。
第 7 步 - 之后生成新令牌。复制生成的令牌并使用此令牌通过用户名和令牌访问 git。
现在在系统中管理您的凭据
对于窗口用户
1.) 打开控制面板 => 用户帐户 => 管理您的凭据 => Windows 凭据。
在密码框中粘贴您的访问令牌,然后单击保存按钮并引用您的桌面。
现在你可以访问git了。
如果您在 android studio 中访问 git,如果要求输入密码,请添加 GitHub 个人访问令牌而不是您的密码。
如果你想使用 android 终端,那么将 cammand 粘贴到终端中
git push https://ghp_FVLWF8rjU4HdsfsdgqSCjzIZh71yoF5N@github.com/username/yourrep.git
Run Code Online (Sandbox Code Playgroud)
小智 7
git config --global --unset credential.helper
Run Code Online (Sandbox Code Playgroud)
上面的代码对我有用。正如@Kunal 所说,我认为我遇到这个问题的一个原因是因为我保存了一段时间的凭据,这导致了身份验证问题。我希望代码有效,这让我难住了一个多小时。
小智 5
这是我如何解决我的。
单击按钮并复制网址。它看起来像这样:git clone https://something@bitbucket.org/something/something.git
git remote remove origin
git remote add origin https://something@bitbucket.org/something/something.gitRun Code Online (Sandbox Code Playgroud)
然后就做 git push 吧。注意:Git 可能会提示你这样做。
git push --set-upstream origin masterRun Code Online (Sandbox Code Playgroud)
做吧。我做了,我的作品现在。
重置 git 凭据:如果是 ubuntu 系统:
取消设置用户名和密码
git config --global --unset credential.helper
git config --unset credential.helper
Run Code Online (Sandbox Code Playgroud)
打开 .git-crendentials 并删除现有的用户名和密码
vim ~/.git-credentials
https://username:password@mygit.github.com 到 https://mygit.github.com
再次存储 git 凭据:
git config --global credential.helper store
git pull
Run Code Online (Sandbox Code Playgroud)
如果是窗户:
转到 Control Panel\User Accounts\Credential Manager
在 Generic Credentials 下,您可以看到存储的 git 密码并将其删除。

| 归档时间: |
|
| 查看次数: |
12538 次 |
| 最近记录: |