GitHub和git的配置

一、git 配置

1. 配置用户名

git config --global user.name "lei"

2. 设置邮箱 

git config --global user.email "[email protected]"

此时,

会在C:\Users\Administrator目录下生成.gitconfig配置文件:

3.查看系统配置

git config --system --list

4.查看当前用户(global)配置

git config --global  --list

5.查看配置信息

git config --list

二、生成公钥

ssh-keygen -t rsa -b 4096 -C "[email protected]"  一直回车即可,不需要设置名称和密码

生成的文件的路径在C:\Users\Administrator\.ssh

查看公钥:

三、GitHub添加公钥

把上面的公钥添加到这里面:

测试GitHub是否可以连通:

OK,配置完成

猜你喜欢

转载自blog.csdn.net/fengkuagn123/article/details/94863635