GIT填写名字和邮箱
git config --global user.name "name"
$ git config --global user.email "xxxxxx@xxxxx.xxx"
查看填写的邮箱和名字
git config –list
查看自己是否已生成公钥密钥
没有就
ssh-keygen -t rsa -C "xxxxxx@xxxxx.xxx"
点击三次回车键
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/Mr.Yang/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /c/Users/Mr.Yang/.ssh/id_rsa.
Your public key has been saved in /c/Users/Mr.Yang/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:zA6wNJrFB6NcqS6eBog/AHlzQuvFjYpG759Yhh1lWGI xxxxxx@xxxxx.xxx(上面自己的邮箱)
The key's randomart image is:
+---[RSA 2048]----+
| +E . |
| ..+oo+ |
| oo+*+.o |
|o.*===+o |
|==+*... S |
|B.+.o .o |
|++o. + . |
| +o.+ . |
|. o.o |
+----[SHA256]-----+
最后在.ssh目录下得到了两个文件:id_rsa(私有秘钥)和id_rsa.pub(公有密钥)
如果想登陆远端,则需要将rsa.pub里的秘钥添加到远端。