Bootstrap

不再被 Git 用户名密码困扰,这里有你需要的解决方案

前言

当我们使用 git 时,经常需要查看或者修改自己的用户名和密码。但是,这个过程可能会遇到一些问题。今天,我们来探讨一下关于如何查看/修改 git 用户名密码的方法。


查看操作

1.查看用户名

git config user.name

2.查看密码

git config user.password

3.查看邮箱

git config user.email

在这里插入图片描述


修改操作

1.修改用户名

git config --global user.name "xxx(新用户名)"

2.修改密码

git config --global user.password "xxx(新密码)"

3.修改邮箱

git config --global user.email "[email protected](新邮箱)"

在这里插入图片描述
注意:

若在修改过程中报以下错误,原因是因为有多个name值,可通过 git config --list 命令查看

报错:

在这里插入图片描述


name:

在这里插入图片描述


解决方法:

git config --global --replace-all user.name "修改的git名称"
git config --global --replace-all uesr.email "修改的git邮箱"

相关推荐

掌握Git,让你的代码版本控制更得心应手!
Git 代码提交规范:构建高质量软件体系的必要准则
无需命令行,用 VSCode 轻松提交 Git 代码
一键提交、轻松推送:IntelliJ IDEA 中 git 的神奇操作

;