I was able to get it to work by creating a config file in ~/.ssh/ folder with below lines: Host bitbucket.org AddKeysToAgent yes IdentityFile ~/.ssh/{ssh-key-name}
I am however not sure why this has to be a mandatory step.