'BitBucket: You are using an account password for Git over HTTPS

Today I got the following message when I used Git + BitBucket on MacOS while pushing a new branch to BitBucket.

You are using an account password for Git over HTTPS.

Beginning March 1, 2022, users are required to use app passwords remote: for Git over HTTPS. To avoid any disruptions, change the password used in your Git client remote: to an app password. Note, these credentials may have been automatically stored in your Git client and/or a credential manager such as Git Credential Manager (GCM).'



Solution 1:[1]

In my case, I used BitBucket via HTTPS and not via SSH. Therefore I had to change it.

  1. Follow this guide to create and add a new SSH key.
  2. Follow this guide to switch from HTTPS to SSH.

Unrelated and optional:

While you are at this security related task, activate 2FA in your BitBucket security settings.

Solution 2:[2]

If you want to use Git over HTTPS :

First, create an app password on bitbucket as described here and keep it somewhere safe :

https://bitbucket.org/blog/deprecating-atlassian-account-password-for-bitbucket-api-and-git-activity

Second, clear credentials :

git config --unset credential.helper

Then you can do any git command and when your password is required, you can use your app password instead of your bitbucket account password.

Ex : git fetch

Solution 3:[3]

Windows 11, git at the command line

I have been using my bitbucket password for authentication.

I only know the basic git commands. I set up an App password. The documentation for this part is good. https://support.atlassian.com/bitbucket-cloud/docs/app-passwords/

Checking your account details

git config user.name
git config user.email
git config user.password

git config --global user.name
git config --global user.email
git config --global user.password

to change values

e.g. 
git config user.name "New name"
gti config --global "New name"

I still had problems, although these values looked correct. I still got the password warning when I did a

git push origin main

As my local repo had no outstanding differences with my master Bitlocker repo I just cloned another copy of the repo from Bitlocker. This fixed the issue

Detailed steps

I moved my local repo to new folder x_reponame

created folder reponame

On the Bitbucket website I went to the repo and selected the Clone button in the top right. This gives you the correct command to clone the repo to my local repository.

from my local terminal git clone https://.....

after adding files and a commit

git push origin main

no longer gave me a password warning.

Solution 4:[4]

For windows users, to continue using GIT over HTTPS:

  1. set up app password - https://bitbucket.org/blog/deprecating-atlassian-account-password-for-bitbucket-api-and-git-activity#How-to-create-an-app-password. make sure to store the password
  2. search and open Credential Manager from Start menu
  3. change to Windows Credential tab.
  4. under Generic Credential you should be able to find git:https://bitbucket.org. select the edit option and replace the password with newly created password.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 Erwan
Solution 3
Solution 4