Cloning a Bitbucket repository via ssh

23,429
  1. Generate an SSH key: ssh-keygen -t rsa -C "your-email-address"
  2. Press Enter key until a randomart image is generated.
  3. Log into Bitbucket -> View profile -> Manage account -> SSH keys -> Add key
  4. Paste the key you have generated in Step 1 in the text box. To get the key, run the following command: cat ~/.ssh/id_rsa.pub
  5. Go to your repository -> Clone. Now you can see the SSH url for your repository. Copy it.
  6. Clone your repository: git clone <ssh-url>
Share:
23,429
Admin
Author by

Admin

Updated on October 31, 2020

Comments

  • Admin
    Admin over 3 years

    How do I clone a repository from Bitbucket via ssh instead of http? I already have git installed in my local machine (Windows).

  • Jaseem Abbas
    Jaseem Abbas about 4 years
    In step 5, do not forget to change HTTPS to SSH in the dropdown. By default, it shows the https url and not the ssh-url. Cheers!
  • dodobird
    dodobird over 2 years
    To make copying hassle free in Step 4, you may use cat ~/.ssh/id_rsa.pub | pbcopy instead.
  • Nditah
    Nditah almost 2 years
    Step 3 should be: Log into Bitbucket -> View profile -> Personal settings -> SSH keys -> Add key. Simple copy and paste this url: bitbucket.org/account/settings/ssh-keys
  • Madlozoz
    Madlozoz almost 2 years
    step 6 Where to I find the ssh-irl of my repository?