I am trying to pull from a remote repo hosted by BitBucket using Sourcetree (v 3.0.1) on a Mac running OS 10.14.4 (Mojave). This was working two weeks ago. It's using the OAuth authentication protocol. I have updated Sourcetree (after it failed the first time), but I don't think I've updated anything else.
I checked whether my ssh agent (OpenSSH) was running from the command line. It didn't seem to be, so I started it. It did not have the private key registered, so I ssh-add'ed it. I checked that I had the right private key, that the public key was registered to my account on BitBucket and that Bitbucket was in my known_host file. I registered my key with the Apple keychain. In the Sourcetree preferences/accounts, I tried using the "connect host" button, which seemed to help in the past, but all it did was open a page in my browser that then redirected back to the SourceTree app. I've rebooted SourceTree. I just get the same error over and over:
git --no-optional-locks -c color.branch=false -c color.diff=false -c color.status=false -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree fetch origin
git@bitbucket.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
I'll mention that I am able to interact with the same repo via a Windows Server2012 workstation (using Pageant via SourceTree).
Please help. I don't need this aggravation.