Bitbucket 无法在 git pull 上进行身份验证

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

Bitbucket fails to authenticate on git pull

gitbitbucket

提问by software is fun

I use BitBucket and had to change my password because it was compromised.

我使用 BitBucket 并且不得不更改我的密码,因为它被泄露了。

git pull

remote: Invalid username or password. If you log in via a third party service you must ensure you have an account password set in your account profile.
fatal: Authentication failed for 'https://bitbucket.org/myusername/myproject.git/'

远程:无效的用户名或密码。如果您通过第三方服务登录,您必须确保在您的帐户配置文件中设置了帐户密码。
致命:“ https://bitbucket.org/myusername/myproject.git/”的身份验证失败

How can I change my password using command line?

如何使用命令行更改密码?

回答by software is fun

You need to reset the password as shown below.

您需要重置密码,如下所示。

On macOS:

在 macOS 上:

git config --global credential.helper osxkeychain

On Windows 10:

在 Windows 10 上:

git config --global credential.helper store

After executing this, it prompts you for the user name and password for your repo.

执行此操作后,它会提示您输入存储库的用户名和密码。

回答by David Motilla

I think is only an authentication problem...

我认为这只是一个身份验证问题......

  1. Click on your Bitbucket account icon (up right) and go to "Manage account".
  2. Go to "Change password" option in left menu.
  3. Enter your password in "New password" and "Confirm password" fields.
  4. Click on "Change password".
  1. 单击您的 Bitbucket 帐户图标(右上角)并转到“管理帐户”。
  2. 转到左侧菜单中的“更改密码”选项。
  3. 在“新密码”和“确认密码”字段中输入您的密码。
  4. 点击“更改密码”。

That's all :)

就这样 :)

回答by Guille Acosta

First, edit your .git/config and remove your username from 'url'.

首先,编辑您的 .git/config 并从“url”中删除您的用户名。

I had this:

我有这个:

url = https://[email protected]/pathto/myrepo.git

And after modification:

修改后:

url = https://bitbucket.org/pathto/myrepo.git

Then try to pull (or push) and use your emailand password credentials to login.

然后尝试拉(或推)并使用您的电子邮件和密码凭据登录。

回答by dtbarne

I needed to do this and run a git pull in order to set my password from the command line in order to get this working.

我需要执行此操作并运行 git pull 以便从命令行设置我的密码以使其正常工作。

Note this method saves your password in a plain text file on your disk:

请注意,此方法会将您的密码保存在磁盘上的纯文本文件中:

git config --global credential.helper store
git pull

Other solutions here: Is there a way to skip password typing when using https:// on GitHub?

此处的其他解决方案: 在 GitHub 上使用 https:// 时是否可以跳过密码输入?

回答by sergiosua

If you are a mac user this worked for me:

如果您是 mac 用户,这对我有用:

  1. open Keychain Access.
  2. Search for Bitbucket accounts.
  3. Delete them.
  1. 打开钥匙串访问。
  2. 搜索 Bitbucket 帐户。
  3. 删除它们。

Then it will ask you for the password again.

然后它会再次要求您输入密码。

回答by Raja Islam

I clicked on this button and it worked for me.

我点击了这个按钮,它对我有用。

Here is the screenshot

这是屏幕截图

回答by Alin Porumb

Lately, BitBucket needs you to generate an App Password:

最近,BitBucket 需要你生成一个应用密码:

Settings/Access Management/App Passwords.

设置/访问管理/应用程序密码。

https://bitbucket.org/account/user/.../app-passwords

https://bitbucket.org/account/user/.../app-passwords

回答by Hoque MD Zahidul

If you found authentication error problem when you entered correct password and username it's git problem. To solves this problem when you are installing the git in your machine uncheck the enable git credential manager enter image description here

如果您在输入正确的密码和用户名时发现身份验证错误问题,则是 git 问题。要在您的机器上安装 git 时解决此问题,请取消选中启用 git 凭据管理器 在此处输入图片说明

回答by ricardopereira

You can update your Bitbucket credentials from the OSX Keychain.

您可以从 OSX 钥匙串更新您的 Bitbucket 凭据。

Updating your cached credentials via the command line:

通过命令行更新缓存的凭据:

$ git credential-osxkeychain erase
host=bitbucket.org
protocol=https
[press return]

If it's successful, nothing will print out. To test that it works, try and clone a repository from Bitbucket. If you are prompted for a password, the keychain entry was deleted.

如果成功,则不会打印任何内容。要测试它是否有效,请尝试从 Bitbucket 克隆一个存储库。如果系统提示您输入密码,则钥匙串条目已被删除。

回答by Ali Sajid

I was facing same error, But I didn't need to change my password.

我遇到了同样的错误,但我不需要更改密码。

Just go to bitbucket->preferences->accountsselect your account and check if your password is correct.

只需去bitbucket->preferences->accounts选择您的帐户并检查您的密码是否正确。

In my case, my password was messed up. Just corrected my password and it worked.

就我而言,我的密码搞砸了。刚刚更正了我的密码,它起作用了。