在命令行输入:
$ git config --global user.name "Your Name" $ git config --global user.email "email@example.com"
查看git用户名和邮箱地址命令:
$ git configuser.name
$ git configuser.email
创建SSH Key
$ ssh-keygen -t rsa -C "youremail@example.com"
然后输入保存公钥的地址,并设置私钥。
进入相应目录查看公钥文件id_rsa.pub,用记事本打开,将公钥复制。
再打开https://github.com/登录Add SSH Key
当git注册时的邮箱发生变化后,可以通过config命令进行修改。