Today I have faced an issue that I couldn’t push/pull to(from) Bitbucket repository. I used Sourcetree and I got failed to do it with the error below.
Invalid username and password
I tried to change my password in Bitbucket and it didn’t work. Also, I tried to reset Bitbucket related keychain in mac os. It still didn’t work.
Remove all your keys in Keychain Access
Most answers in the web suggests you to remove all your keys in Keychain Access app on your Mac. I did it, too. Before you take it below try this at the first.
Using SSH in Shell
I recreated a private/public key pair using below.
ssh-keygen -t ed25519 -C "email@example.com"
Then I added the public key to Bitbucket account. Then I tried to test it using SSH-Agent.
ssh -T firstname.lastname@example.org
Then I went back to Sourcetree and tried it again. It finally worked. It was a strange that I didn’t get any issue on Github and Gitlab. I think that the experience of Bitbucket is getting more complicated than other Git cloud services.