Got a fatal invalid credentials or authentication failed error when you tried to push to Bitbucket This guide explains how to make a Bitbucket app password and shoehorn it into Git so your pushes stop acting like a dramatic breakup
Bitbucket app passwords are short lived only in their display time and tiny compared to the emotional lifespan of a bad commit message They let you authenticate Git operations without handing over your main account password which is a very good thing if you like sleep and not getting locked out
Sign in to the Bitbucket web console then open Personal settings and choose App passwords Click Create app password Give it a sensible label like git push helper Grant repository read and write if you plan to push Note the site will show the secret only once so copy it and hide it somewhere safer than a sticky note on your monitor
If your remote uses an anonymous url Git may not know who you are Set a remote that includes your Bitbucket username so Git asks for credentials
git remote set-url origin https://bitbucket.org/username/repo.git
Replace username and repo with your actual values This forces Git to prompt for a username and password on next network operation
Old credentials are clingy and will be tried until they die Remove any saved Bitbucket entries from your OS credential store For Windows open Credential Manager and delete the entry For macOS open Keychain Access and delete the saved credential On Linux remove entries managed by your credential helper or run a helper specific command
If you like terminal incantations you can also run an interactive reject which tells Git to forget a url
printf 'url=https://bitbucket.org\n' | git credential reject
When Git asks for a password paste the app password you generated earlier The username is still your Bitbucket username If you use a GUI credential helper it will usually offer to save the new app password so you do not have to paste it every time
Run a simple command like
git push origin main
If the fatal invalid credentials or authentication failed message goes away congratulations You have taught Git a new trick
This was a short and mildly judgmental guide to creating a Bitbucket app password updating your Git remote clearing cached credentials and testing your connection Now go push something useful and spare us another authentication failed error report
I know how you can get Azure Certified, Google Cloud Certified and AWS Certified. It's a cool certification exam simulator site called certificationexams.pro. Check it out, and tell them Cameron sent ya!
This is a dedicated watch page for a single video.