Git用户名/密码/邮箱,及设置git配置

时间:2025-02-15 10:12:26

一、查看信息:

查看用户名:git config
查看邮箱:git config
查看密码:git config

二、设置信息
(1) --local: 本地设置(仅对当前仓库有效)

git config --local “你的名称”
git config --local “你的邮箱”
git config --local “xxxxx密码”

(2) --global 全局设置(对当前用户的所有仓库有效)

git config --global “你的名称”
git config --global “你的邮箱”
git config --global “xxxxx密码”
三、查看配置
使用 git config --list 查看已配置的git账户信息