I've configured ~/.gitconfig
correctly as below.
git config --global user.name "yuzhi"
git config --global user.email "1762266120@qq.com"
Here is the result.
saber@debian:~$ git config -l
user.name=yuzhi
user.email=1762266120@qq.com
core.editor=vim
color.ui=true
saber@debian:~$ git config --global -l
user.name=yuzhi
user.email=1762266120@qq.com
core.editor=vim
color.ui=true
What confuses me is that it does not work when i git commit
.
saber@debian:~/ics2020$ sudo git commit
*** Please tell me who you are.
Run
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
to set your account's default identity.
Omit --global to set the identity only in this repository.
fatal: unable to auto-detect email address (got 'root@debian.(none)')
But it works when i issue git commit
after the commands below.
git config --local user.name "yuzhi"
git config --local user.email "1762266120@qq.com"
BTW:
i'm running Debian-10.8
on the vmware.
and git==2.20.1
.
here is the similar question as mine, but i don't know how to solve in linux.