How can I solve “fatal: Invalid credentials” error when pushing to Bitbucket?

Issue

My Bitbucket password is correct because I can easily log in with this password. When I try to push a project or file to Bitbucket it shows “Invalid credentials error”.

Solution

When prompted to log in, use your username, but instead of your usual account password, use the app password:

To get the app password

  1. Go to the bitbucket.org website and log in
  2. From your gear in the upper right, and click Personal Bitbucket settings
  3. Click App passwords under Access management
  4. Click Create app password
  5. Give the app password sufficient rights (probably write on the repo at a minimum), and a label related to the application that will use the password
  6. Don’t forget to save that password

Leave a comment

Your email address will not be published. Required fields are marked *