一。查看电脑git配置
$ git config --list
user.name=beijing
user.email=727906773@qq.com
二。如果没有配置,进行配置
配置用户名 $ git config --global user.name "beijing"
配置邮箱 $ git config --global user.email "727906773@qq.com"
三。配置完成后,配置SSH(远程代码库需要)
$ ssh-keygen -t rsa -C "727906773@qq.com"
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/LoL/.ssh/id_rsa):(回车)
/c/Users/LoL/.ssh/id_rsa already exists.
Overwrite (y/n)? y (注意:如果第一配置,这里不会出现,第二次配置,会询问是否覆盖第一次,选y就OK了)
Enter passphrase (empty for no passphrase):(回车)
Enter same passphrase again:(回车) 生成 ☟
Your identification has been saved in /c/Users/LoL/.ssh/id_rsa.
Your public key has been saved in /c/Users/LoL/.ssh/id_rsa.pub.
四。将ssh添加到远程库中,测试是否成功
$ ssh -T git@code.aliyun.com