Git配置
多git仓库配置
.ssh/config
Host github.com
HostName github.com
User yourname@gmail.com
IdentityFile ~/.ssh/id_ed25519_github
Host gitee.com
HostName gitee.com
User yourname@qq.com
IdentityFile ~/.ssh/id_ed25519_gitee
Host gitlab.com
HostName gitlab.com
User yourname@gmail.com@qq.com
IdentityFile ~/.ssh/id_ed25519_gitlab
配置git的name和email
查看
git config --global user.name
git config --global user.email
配置
git config --global user.name "你的用户名"
git config --global user.email "你的邮箱地址"
为特定的Git仓库设置不同的用户名和电子邮件地址,可以在当前仓库目录下运行命令。
设置
git config user.name "其他用户名"
git config user.email "其他邮箱地址"
这会在当前仓库的配置文件
.git/config
中设置用户名和电子邮件地址,只会影响到该仓库的提交。