Github 相关

GIT 查看/修改用户名和邮箱地址

用户名和邮箱地址的作用

用户名和邮箱地址是本地 git 客户端的一个变量,不随 git 库而改变。

每次 commit 都会用用户名和邮箱纪录。

github 的 contributions 统计就是按邮箱来统计的。

查看用户名和邮箱地址

git config user.name
git config user.password
git config user.email

配置用户名和邮箱地址

git config --global user.name "desonglll" && git config --global user.password "Lindesong7758?" && git config --global user.email "[email protected]"

配置 SSH

一、生成 SSH Key

ssh-keygen -t rsa -C "[email protected]"

上述操作执行完毕后,在 ~/.ssh/ 目录会生成 XXX-rsa (私钥)和 XXX-rsa.pub (公钥)

二、添加公钥到你的远程仓库(github)

1 、查看你生成的公钥

cat ~/.ssh/id_rsa.pub

这里会把公钥显示出来,我们把这段内容复制出来。

2、添加公钥到远程仓库