生成Git公钥
- 打开git-bash
- 配置git配置git
// 配置用户名
git config --global user.name "username"
// 配置邮箱
git config --global user.email "xxx.@xx.com"
// 查看配置
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
user.email=xxx.@xx.com
- 生成公钥
$ ssh-keygen -t rsa -C "xxx.@xx.com"
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 jinhuan11@qq.com
The key’s randomart image is:
±–[RSA 2048]----+
| .oOB. |
| ++o. |
| . =o= o |
| …= = . . |
| oo + S . E |
| …=. . |
| . .+o. . . |
|. o=o=o… . |
|.o=*= .oo |
±—[SHA256]-----+
- 拷贝公钥
将id_rsa.pub
里面的内容一字不漏的拷贝到