git添加密钥(没有密钥的情况)

本文详细介绍了如何在Windows上下载并安装Git Bash,生成SSH密钥对,将公钥添加到GitHub账户中,以便安全地进行版本控制和代码同步。通过这个过程,开发者可以实现本地开发环境与GitHub的无缝连接。
摘要由CSDN通过智能技术生成

1、下载Git Bash(git for windows):​​​​​​Git for Windows

2、输入(邮箱为自己github的邮箱)

ssh-keygen -t ed25519 -C "your_email@example.com"

3、创建公钥、私钥

提示您“Enter a file in which to save the key(输入要保存密钥的文件)”时,按 Enter 键。 这将接受默认文件位置。

> Enter a file in which to save the key (/c/Users/you/.ssh/id_algorithm):[Press enter]

在提示时输入安全密码。(在输入密码时不会显示)

> Enter passphrase (empty for no passphrase): [Type a passphrase]
> Enter same passphrase again: [Type passphrase again]

4、获取密钥

$ clip < ~/.ssh/id_ed25519.pub
# Copies the contents of the id_ed25519.pub file to your clipboard

如果 clip 不可用,可找到隐藏的 .ssh 文件夹,在常用的文本编辑器中打开该文件,并将其复制到剪贴板。

5、将密钥添加到git hub的账户上

在git hub的个人信息界面找到设置,在设置里找到SSH and GPG keys

title中添加描述性语言

key中添加密钥

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值