BitBucket: You are using an account password for Git over HTTPS
Asked Answered
I

4

12

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).'

Idiocy answered 24/1, 2022 at 10:46 Comment(1)
the question was asked for macOS, which helped me, but should we clean up the Q&A so they are platform friendly?Kinsfolk
I
13

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.

Idiocy answered 24/1, 2022 at 10:46 Comment(3)
Shouldn't you be able to keep using HTTPS if you generate the app password they're talking about and then set it with git config? I'm trying to do this but so far have only made the password and am not sure which variable to set in the config to make this work.Operon
@PavelKomarov, See this:community.atlassian.com/t5/Bitbucket-questions/… In summary, open keychain and type "bitbucket.org" in the search. Delete everything in the results associated with Bitbucket. Do a new push. You will be prompted to enter the password. Enter your new app password. Done.Samarasamarang
@PavelKomarov I think that's the alternative, yes. However, I wanted to go the standardized way with SSH, so I laid out the steps for this one.Idiocy
N
8

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
Nitrometer answered 1/2, 2022 at 17:3 Comment(2)
This lacks proper information on how to even set app passwords to being on... right now, still get the message stating "You are using an account password ofr Git over HTTPS" even when doing the above.Neuralgia
Credential helper in macOS will appear with the same value, like this: $ git config --list credential.helper=osxkeychain Once you unset, git will securely ask for the password via the command session, and store it. Before and after, it will always appear the same.Kinsfolk
B
2

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.

Blether answered 30/1, 2022 at 20:35 Comment(0)
B
2

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.
Beastly answered 28/2, 2022 at 11:37 Comment(1)
Thank you :) also please note that you can just change the password directly in CMKatha

© 2022 - 2024 — McMap. All rights reserved.