How to use the same key for Git Bash and Sourcetree.

To create the SSH key you can use PuTTYgen.

It will create private.ppk and public.

Then using the same window export to openssh and create id_rsa


Using the following command in Git Bash create id_rsa.pub

ssh-keygen -i -f public > id_rsa.pub

Copy the content of public and import it into Bitbucket. If you don’t know how read the “Add the public key to your Bitbucket settings” section in here.

Add the code in here to your ~/.bashrc so it runs the agent every time you open Git Bash.

Now, you can push to your Bitbucket repository using Git Bash or Sourcetree without password.

Comments