DEV Community

David Carr
David Carr

Posted on • Originally published at dcblog.dev on

Fatal: Authentication failed (on git push)

Problem

Lost authentication from BitBucket resulting in invalid credentials. Pushing to BitBucket and received this response:


remote: Invalid credentials
fatal: Authentication failed for **repo**
Enter fullscreen mode Exit fullscreen mode

Solution

  1. Go to https://bitbucket.org/account/settings/app-passwords/ and create a new app password

  2. Tick all the permissions required, copy the password

In terminal:

On an already-cloned project:


git remote set-url origin https://bitbucket-username:app-password@bitbucket.org/repo-name.git
Enter fullscreen mode Exit fullscreen mode

To clone a new project:


git clone https://bitbucket-username:app-password@bitbucket.org/repo-name.git
Enter fullscreen mode Exit fullscreen mode

Why is it happening?

Beginning March 1, 2022, you will no longer be able to use your Atlassian account password when using Basic authentication with the Bitbucket Cloud REST API or Git over HTTPS.

Solution has been provided from StackOverflow - https://stackoverflow.com/questions/71378839/how-can-i-solve-this-invalid-credentials-problem-on-bitbucket

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs