//设置user.name和email 提交到git之后会显示用户名(在随意一个目录打开git-bash执行就行) Administrator@DESKTOP-BP3H0HS MINGW64 /d/midou (master)$ git config --global user.name "liuchao"Administrator@DESKTOP-BP3H0HS MINGW64 /d/midou (master)$ git config --global user.email "liuchao102@163.com" //生成秘钥Administrator@DESKTOP-BP3H0HS MINGW64 /d/midou (master)$ ssh-keygen -t rsa -C "liuchao102@163.com" Generating public/private rsa key pair.Enter file in which to save the key (/c/Users/Administrator/.ssh/id_rsa):/c/Users/Administrator/.ssh/id_rsa already exists.Overwrite (y/n)? yEnter passphrase (empty for no passphrase):Enter same passphrase again:Your identification has been saved in /c/Users/Administrator/.ssh/id_rsa.Your public key has been saved in /c/Users/Administrator/.ssh/id_rsa.pub.The key fingerprint is:SHA256:N20m0PnwfNSZZaCOvp8gW8Fac49kIQo1fUMz+490AO8 “liuchao102@163.comThe key's randomart image is:+---[RSA 2048]----+| o. .= ..o|| . o..oB o+|| . . =.+.+o.|| . + X = . || S X % E .|| = @ = + || o + . o .|| + o . || . ..o |+----[SHA256]-----+Administrator@DESKTOP-BP3H0HS MINGW64 /d/midou (master)$ 转载自: