在Windows上为Bitbucket设置SSH密钥 [英] Setting up SSH keys for Bitbucket on Windows

查看:669
本文介绍了在Windows上为Bitbucket设置SSH密钥的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,我绝对是git,repos和命令行的菜鸟.我已经在Bitbucket上进行了回购,并且我基本上希望能够通过gitbash推送到存储库,而不必每次都输入密码.

First, I am an absolute noob with git, repos and command line. I have repo on Bitbucket and I basically want to be able to push to the repository via gitbash without entering a password each time.

我有什么:

  • Bitbucket上已设置代码的存储库.
  • 克隆存储库的本地目录.
  • 通过PuTTY生成的公钥和私钥.
  • 通过管理SSH密钥"页面将公共密钥添加到Bitbucket.

现在如何使它起作用,以便每次从gitbash终端推送时都不必输入密码?我正在使用Windows 10.

How do I now make it work so that I don't have to enter the password each time I push from the gitbash terminal? I'm using Windows 10.

推荐答案

请按照以下步骤将ssh密钥添加到bitbucket帐户中以解决您的问题.

Please follow the steps to add ssh key into bitbucket account to solve your issue.

  1. 打开git bash终端并输入命令 ssh-keygen -t rsa -C您的电子邮件地址"
  2. 输入密码短语(将其保留为空白),然后输入
  3. 再次输入相同的短语(将其保留为空白),然后输入
  4. 从系统中的 id_rsa.pub 文件内容中复制文件内容( C:\ Users \ username \ .ssh )
  5. 登录到bitbucket帐户,然后单击安全菜单下最右上方的用户图标-> bitbucket设置-> ssh密钥,然后将其粘贴到密钥字段中并保存. 6.重新启动git bash终端并输入 git init 命令并添加ssh git存储库位置 git@bitbucket.org:username/repository_name.git ,该位置存在于您的bitbucket存储库中.
  1. Open git bash terminal and enter the command ssh-keygen -t rsa -C "your email address"
  2. Enter passphrase (leave it blank) and enter
  3. Enter the same phrase again (leave it blank) and enter
  4. Copy the id_rsa.pub file content from where it is residing in your system (C:\Users\username\.ssh)
  5. Login to bitbucket account and click top right most user icon ->bitbucket settings->ssh keys under security menu then paste into key field and save it. 6.Restart your git bash terminal and enter git init command and add ssh git repository location git@bitbucket.org:username/repository_name.git which is present in your bitbucket repository.

享受!

这篇关于在Windows上为Bitbucket设置SSH密钥的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆