本帖最后由 Qter 于 2020-1-12 12:40 编辑  
 
如果只有一个项目,可用下面方法设置一个全局账号: 
git config --global user.email "you@example.com" 
git config --global user.name "Your Name" 
设置完后,用如下命令查看: 
git config --global --get user.name 
git config --global --get user.email 
 
针对项目设置账号: 
git config --local user.email "xxx@xxx.com" 
git config --local user.name "xxx" 
 
 
 
Git - git config 查看配置信息前言    git 中通过 git config查看配置信息 
    config 配置有system级别 global(用户级别) 和local(当前仓库)三个 
    设置先从system -》global -》local 底层配置会覆盖顶层配置 分别使用–system/global/local 可以定位到配置文件 查看系统config 
git config --system --list 
 
相关路径:'C:\Program Files\Git\mingw64/etc/gitconfig' 
 
查看当前用户(global)配置 
 
git config --global  --list 
 
查看当前仓库配置信息 
 
git config --local  --list 
 
core.repositoryformatversion=0 
core.filemode=false 
core.bare=false 
core.logallrefupdates=true 
remote.origin.url=git@chkj.hotmail.com:chunhuitech/ch-web-ch.git 
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/* 
branch.master.remote=origin 
branch.master.merge=refs/heads/master 
 |