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?
If you are a mac user this worked for me:
Then it will ask you for the password again.
This answer is for SO users who browse here after searching for the error.
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.
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 think is only an authentication problem...
That's all :)
You can update your Bitbucket credentials from the OSX Keychain.
Updating your cached credentials via the command line:
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.
You need to reset the password as shown below.
On macOS:
On Windows 10:
After executing this, it prompts you for the user name and password for your repo.
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