生成Git公钥

生成Git公钥

  1. 打开git-bash
    在这里插入图片描述
  2. 配置git配置git
// 配置用户名
git config --global user.name "username"
// 配置邮箱
git config --global user.email "[email protected]"
// 查看配置
git config --list  同等于下面的 git config -l

> $ git config -l
core.symlinks=false
core.autocrlf=true
core.fscache=true
color.diff=auto
color.status=auto
color.branch=auto
color.interactive=true
help.format=html
rebase.autosquash=true
http.sslcainfo=E:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
http.sslbackend=openssl
diff.astextplain.textconv=astextplain
filter.lfs.clean=git-lfs clean -- %f
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.process=git-lfs filter-process
filter.lfs.required=true
credential.helper=manager
core.editor='E:\Program Files\Microsoft VS Code\Code.exe' --wait
user.name=username
[email protected]
  1. 生成公钥

$ ssh-keygen -t rsa -C "[email protected]"
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/jinhuan/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /c/Users/jinhuan/.ssh/id_rsa.
Your public key has been saved in /c/Users/jinhuan/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:EH6janbIi9teJBlSbZgxEf4BywfQ6/iC3vp3u2B5d9Q [email protected]
The key’s randomart image is:
±–[RSA 2048]----+
| .oOB. |
| ++o. |
| . =o= o |
| …= = . . |
| oo + S . E |
| …=. . |
| . .
+o. . . |
|. o=o=o… . |
|.o=*= .oo |
±—[SHA256]-----+

  1. 拷贝公钥
    在这里插入图片描述
    id_rsa.pub里面的内容一字不漏的拷贝到
    在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/jin_huan11/article/details/83451677