简体   繁体   English

通过 ssh 克隆 Bitbucket 存储库

[英]Cloning a Bitbucket repository via ssh

How do I clone a repository from Bitbucket via ssh instead of http ?如何通过ssh而不是http从 Bitbucket 克隆存储库? I already have git installed in my local machine (Windows).我已经在本地机器(Windows)中安装了git

  1. Generate an SSH key: ssh-keygen -t rsa -C "your-email-address"生成 SSH 密钥: ssh-keygen -t rsa -C "your-email-address"
  2. Press Enter key until a randomart image is generated.按 Enter 键,直到生成随机艺术图像。
  3. Log into Bitbucket -> View profile -> Manage account -> SSH keys -> Add key登录 Bitbucket -> View profile -> Manage account -> SSH keys -> Add key
  4. Paste the key you have generated in Step 1 in the text box.将您在步骤 1 中生成的密钥粘贴到文本框中。 To get the key, run the following command: cat ~/.ssh/id_rsa.pub要获取密钥,请运行以下命令: cat ~/.ssh/id_rsa.pub
  5. Go to your repository -> Clone . Go 到您的存储库 -> Clone Now you can see the SSH url for your repository.现在您可以看到存储库的 SSH url。 Copy it.复制它。
  6. Clone your repository: git clone <ssh-url>克隆您的存储库: git clone <ssh-url>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM