1

I have read 100's of posts and tried dozens of things, give or take, to get Windows 10 and my git bash push to work with the Bitbucket Cloud and their App password mandate enforced on March 1st 2022. I decided to reach out to the stack team before I harm a monitor, laptop or myself. 10 hours in and I give up. Mea Culpa.

Using git bash:
$ git push -u origin master

Gets me:

remote: Bitbucket Cloud recently stopped supporting account passwords for Git authentication.
remote: See our community post for more details: https://atlassian.community/t5/x/x/ba-p/1948231
remote: App passwords are recommended for most use cases and can be created in your Personal settings:
remote: https://bitbucket.org/account/settings/app-passwords/
fatal: Authentication failed for 'https://bitbucket.org/myWorkspace/myRepo.git/'

  • Windows 10
  • git bash version 2.35.1.windows.2
  • using bitbucket web interface to view my repositories and add app passwords --- https://bitbucket.org/
  1. My bitbucket account has my work email address and a username associated with it.
  2. I have a Bitbucket Cloud workspace, project and repository that I have been pushing into for several years.
  3. I have used both Visual Studio and Git Bash to access this repository.
  4. I did not create the repository. Our company admin did.
  5. I am the only user of the repository and the only userid that has ever pushed to it.

Both access methods VS2019 and Git Bash quit working for me around Mar. 10th when I tried my first Commit and Push since Dec2021.

Since my first error on March 10th.
I have added an app password via bitbucket web interface by:

1 - Left click my avatar lower left of bitbucket web page
2 - Select Personal Settings
3 - Select App Passwords on the left
4 - Click Blue Create App Password button

5 - Labeled it: GitBash

6 - Selected all the permissions below -

Account

 x - Email
 x - Read
 x - Write

Workspace membership

 x - Read
 x - Write

Projects

 x - Read
 x - Write

Repositories

 x - Read
 x - Write
 x - Admin
 not - Delete

Pull requests

 x - Read
 x - Write

7 - Then hit the blue Create button.

8 - I then got the screen that displayed the 20 char password. I copied it to notepad temporarily and then put it in the git command below:

 $ git remote set-url origin https://myUserid:myAppPassword1234567@bitbucket.org/my-workspace/myrepo.git

I then try my push again:

 $ git push -u origin master

and get the response:

remote: Bitbucket Cloud recently stopped supporting account passwords for Git authentication.
remote: See our community post for more details: https://atlassian.community/t5/x/x/ba-p/1948231
remote: App passwords are recommended for most use cases and can be created in your Personal settings: remote: https://bitbucket.org/account/settings/app-passwords/
fatal: Authentication failed for 'https://bitbucket.org/myWorkspace/myRepo.git/'

 $ git config --global --list

core.editor="C:\Users\first last\AppData\Local\Programs\Microsoft VS Code\bin\code" --wait
user.name=myUserid
user.email=myUserid@myCompany.com
credential.bitbucketauthmodes=basic
credential.microsoft.visualstudio.com.authority=BitBucket
difftool.sourcetree.cmd='' "$LOCAL" "$REMOTE"
mergetool.sourcetree.cmd=''
mergetool.sourcetree.trustexitcode=true

 $ git remote -v  

origin https://myUserid:myAppPassword1234567@bitbucket.org/my-workspace/my-repo.git (fetch)
origin https://myUserid:myAppPassword1234567@bitbucket.org/my-workspace/my-repo.git (push)

The output from the remote -v is exactly as I set it up with the $ git remote set-url command.

 $ git config --list  

http.sslbackend=openssl http.sslcainfo=C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
credential.helper=manager-core
diff.astextplain.textconv=astextplain
filter.lfs.clean=git-lfs clean -- %f
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.process=git-lfs filter-process
filter.lfs.required=true core.autocrlf=true core.fscache=true
core.symlinks=false pull.rebase=false
credential.https://dev.azure.com.usehttppath=true
init.defaultbranch=master core.editor="C:\Users\my-first Wilson\AppData\Local\Programs\Microsoft VS Code\bin\code" --wait
user.name=bwilson user.email=myUserid@myCompany.com
credential.bitbucketauthmodes=basic
credential.microsoft.visualstudio.com.authority=BitBucket
difftool.sourcetree.cmd='' "$LOCAL" "$REMOTE"
mergetool.sourcetree.cmd='' mergetool.sourcetree.trustexitcode=true
core.repositoryformatversion=0
core.filemode=false
core.bare=false
core.logallrefupdates=true
core.symlinks=false
core.ignorecase=true
submodule.active=.
remote.origin.url=https://myUserid:myAppPassword1234567@bitbucket.org/myWorkspace/myRepo.git

remote.origin.fetch=+refs/heads/:refs/remotes/origin/

C:\Users<username>.git-credentials

has one record in it:

https://myUserid:myAppPassword1234567@bitbucket.org

I have been coding for decades but haven't done a lot with git and bitbucket so I'm sure this is me, but I could use some help. I will answer any questions, run any tests and provide any results. Thanks!

  • 1
    Clear your windows credentials https://stackoverflow.com/a/15382950/372935 . Also `username:password` won't work. just use `username@` then it will ask you to login – Aivan Monceller Apr 12 '22 at 13:41
  • My apologies for going outside of the intent of SO, but you are too gracious. Understanding that security must move forward, Atlassian has nonetheless wasted thousands, possibly millions of developer hours breaking a very fundamental component with minimal support for the varied cases. We are expected to immediately understand various nuances such as when to use app passwords vs. our own logins and in which scenario "our own" is our email vs. a more classic username. And at the heart of it, the core of what we do is being held hostage. – John Spiegel Apr 18 '22 at 17:19

0 Answers0