git用户设置

发布时间 2023-09-06 19:12:39作者: 少昊

1.清除git记住的用户密码: (如果没权限看下git下的etc目录-属性-安全,设置用户组权限)
git config --system --unset credential.helper
然后记住密码
git config –global http.emptyAuth true
git config --global credential.helper store
再次进行 Git 操作,输入正确的用户名,密码即可。

2.查看git设置的用户和邮箱
git config --global user.name
git config --global user.email
3.设置用户和邮箱
git config --global user.name '用户名'
git config --global user.email ''
4.生成密钥
ssh-keygen -t rsa -C '邮箱'