Permission denied (publickey)

I wrapped up Baptiste Augrain’s solution to the Permission denied (publickey) problem in a bash file called ssh_git.sh, made it executable (chmod +x ssh_git.sh), and run it whenever I run into the error message when pushing to a Bitbucket repository.

ssh-add ~/.ssh/bitbucket-key # replace this with your key path
ssh-add -l
ssh -Tv git@bitbucket.org