Git 切换账号

2023-04-23  本文已影响0人  狼性代码人

一、修改 git config 信息

git config --list
// 修改 name
git config --global user.name "XXX"
// 修改 email
git config --global user.email "XXX"

// 查看修改后信息
git config --list

二、重新生成 SSH Public Key 信息

ssh-keygen -t rsa -C "xxxx@xxx.com"
ssh-add
cat .ssh/id_rsa.pub

三、查看 ssh config 信息并修改

cat ~/.ssh/config

最后记得提交一笔代码进行测试

上一篇 下一篇

猜你喜欢

热点阅读