I use BitBucket and had to change my password because it was compromised.
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/'
How can I change my password using command line?
You need to reset the password as shown below.
On macOS:
git config --global credential.helper osxkeychain
On Windows 10:
git config --global credential.helper store
After executing this, it prompts you for the user name and password for your repo.
I think is only an authentication problem...
- Click on your Bitbucket account icon (up right) and go to "Manage account".
- Go to "Change password" option in left menu.
- Enter your password in "New password" and "Confirm password" fields.
- Click on "Change password".
That's all :)
First, edit your .git/config and remove your username from 'url'.
I had this:
url = https://username@bitbucket.org/pathto/myrepo.git
And after modification:
url = https://bitbucket.org/pathto/myrepo.git
Then try to pull (or push) and use your email and password credentials to login.
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.
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?
If you are a mac user this worked for me:
- open Keychain Access.
- Search for Bitbucket accounts.
- Delete them.
Then it will ask you for the password again.
I clicked on this button and it worked for me.
Here is the screenshot
Lately, BitBucket needs you to generate an App Password:
Settings/Access Management/App Passwords.
You can update your Bitbucket credentials from the OSX Keychain.
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.
This answer is for SO users who browse here after searching for the error.
- Terminal will not accept your Bitbucket or Atlassian web app password if
your account is associated with an Atlassian (Jira) account. If this is your case, you have a giant string generated for you that you can find in your MacOSX keychain app. This is the password Terminal accepts. - It is not clear how to re-generate this password or re-set it to match what Bitbucket will accept.
- Changing password in SourceTree's settings did not work for me.
- Changing password in Atlassian account profile did not work for me.
- Bitbucket does not have a link or interface to change password for this case in the Bitbucket account profile - user has to go to Atlassian account profile.
In my case, nothing worked because I changed my username in Bitbucket.
Atlassian and Bitbucket are not completely integrated. Bitbucket uses the Atlassian user email and web app password, but allows you to have a different username.
There seems to be a bug in this process, especially since it's not clear which application or process is generating the authentication and where it's stored or editable. Changing the username breaks authentication.
There may be a way to update the username used by the credentials and Bitbucket, but I was already several hours behind when I discovered that changing my username back to what it was before restored authentication.
I was facing same error, But I didn't need to change my password.
Just go to bitbucket->preferences->accounts select your account and check if your password is correct.
In my case, my password was messed up. Just corrected my password and it worked.
I know that this is an old question, but I thought I would provide the solution that worked for me. I signed up for bitbucket using my google account and did not have a password. Turns out the password is my Atlassian account password. If you have an Atlassian account then try this password to see if it works.
For me the issue was I changed my username so the git url also got changed. So I had to set the new git url using
git remote set-url origin <URL>
For MacOS below steps help me ...
- Got to the folder ~/Library/Application Support/SourceTree
- Delete the file {Username}@STAuth-bitbucket.org
- Restart Sourcetree
- Try to fetch, password filed appear, give your new password
- Also can run "git fetch" command in terminal and need to type password
- Done
来源:https://stackoverflow.com/questions/33413890/bitbucket-fails-to-authenticate-on-git-pull
