Cloning a Bitbucket repository via ssh
23,429
- Generate an SSH key:
ssh-keygen -t rsa -C "your-email-address"
- Press Enter key until a randomart image is generated.
- Log into Bitbucket ->
View profile
->Manage account
->SSH keys
->Add key
- 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
- Go to your repository ->
Clone
. Now you can see the SSH url for your repository. Copy it. - Clone your repository:
git clone <ssh-url>
Author by
Admin
Updated on October 31, 2020Comments
-
Admin over 3 years
How do I clone a repository from Bitbucket via
ssh
instead ofhttp
? I already havegit
installed in my local machine (Windows). -
Jaseem Abbas about 4 yearsIn 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 over 2 yearsTo make copying hassle free in Step 4, you may use
cat ~/.ssh/id_rsa.pub | pbcopy
instead. -
Nditah almost 2 yearsStep 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 almost 2 yearsstep 6 Where to I find the ssh-irl of my repository?