I spent hours and hours to get access via sourcetree to the bitbucket with ssh key without luck.
> git remote -v
=> shows currently origin ssh://bitbucket.org/...
test of the ssh key (loaded)
> ssh -T email@example.com
=> authenticated via ssh key. You can use git to connect to Bitbucket. Shell access is disabled
In sourcetree > account > I can connect the account and I also see the ssh key used.
Auth type: OAuth; protocol: ssh
When checking in sourcetree project settings > remotes > add > selecting the repos on my account doesn't show any repos.
For now I start using tower app as this seems to work well.
Sorry to hear about this problem. I recommend checking out this related thread over in https://community.atlassian.com/t5/Sourcetree-questions/Sourcetree-has-invalid-credentials-but-cannot-clear-reset-them/qaq-p/753478
If the initial answer doesn't help, try David S' approach here:
The only thing that worked for me was navigating to C:\Users\USERNAME\AppData\Local\Atlassian\SourceTree and removing the passwd file.
Once this file is removed, restart SourceTree and execute a fetch or something else that requires access to the repo in question. SourceTree will then prompt you for your password, rewriting the cached credentials.