git 远程:未经授权致命:身份验证失败 Bitbucket

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/35008358/
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 03:53:02  来源:igfitidea点击:

remote: Unauthorized fatal: Authentication failed Bitbucket

gitversion-controlbitbucket

提问by Suraj

Ok, so Here's the scenario,

好的,所以这是场景,

I had user1 logged in to my terminal for bitbucket account.

我让 user1 登录到我的终端以获取 bitbucket 帐户。

I had logged in like

我已经登录了

$ git config --global user.name "user1"
$ git config --global user.email "[email protected]"

I was able to do commitand pushperfectly.

我能够做到commit并且push完美无缺。

Now I had another account on bitbucket with another email id for user2.

现在我在 bitbucket 上有另一个帐户,用户 2 有另一个电子邮件 ID。

So I logged in like:

所以我登录如下:

$ git config --global user.name "user2"
$ git config --global user.email "[email protected]"

But now when I am doing git push origin masterI am getting the below error.

但是现在当我这样做时,git push origin master我收到以下错误。

fatal: Authentication failed for 'https://[email protected]/user3/test.git/'

So I completely uninstalled gitfrom my Ubuntu 14.04 and installed it again and logged in again. But even then getting the same issue.

所以我git从我的 Ubuntu 14.04完全卸载并重新安装并再次登录。但即便如此,也会遇到同样的问题。

How to avoid that error message?

如何避免该错误消息?

回答by VonC

The user.nameand user.emaillocal config have nothing to do with git repos hosting server authentication. It is just for committer/authorship on commits.

user.nameuser.email本地配置都无关,与托管服务器认证的git回购。它仅适用于提交的提交者/作者。

If you are using an https url, that means you need to use the BitBucket loginand password.
If there is a BitBucket account 'user2', then its BitBucket password will be enough to pass the authentication (he/she will need to be a collaborator in user3 project in order to have the right to push though)

如果您使用的是 https 网址,则意味着您需要使用 BitBucket登录名和密码。
如果有BitBucket账户' user2',那么它的BitBucket密码就足以通过认证(他/她需要是user3项目的合作者才能有推送的权利)

Make sure there is no special character in the password, or you would have to percent-encode it.

确保密码中没有特殊字符,否则您必须对其进行百分比编码

回答by John

I faced the same problem! Even after providing correct password it showed the same error.

我遇到了同样的问题!即使在提供正确的密码后,它也显示相同的错误。

Solution

解决方案

Step:Just check your pass is correct. if it is OK then check you have the correct permission on that repository. (i got permission problem and solved using the step)

步骤:只需检查您的通行证是否正确。如果没问题,请检查您对该存储库具有正确的权限。(我遇到了权限问题并使用该步骤解决了)