Git config account information

Stephen Lee
Oct 17, 2022

--

When we use git on a server first time, it will report the following error if we didn’t set the email and name:

*** Please tell me who you are.Rungit 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: empty ident name (for <username@servername.(none)>) not allowed

We can use git config --global user.email to set the email to the global scope, we can also omit the --global to set the email only for the current repository.

Unset the global config, we can use --unset option like this:

git config --global --unset user.email

The config file

The git config settings were saved on file, the global config file is ~/.gitconfig , the repository config file is ./.git/config .

--

--

Stephen Lee

I am a software engineer, I like to use the computer to solve problems. website: https://blog.y9i.cc/