Configure Git User Name and Email Address

Very frequent error message...

Page content

After clonning the git repository, do the local repository configuration, particularly set user name and email address.

When you doing first commit to newly clonned repo via command line like

git commit -m "test commit msg"

you might receive a sencible message and git do what expected:

[master 3506e11] test commit msg
 Committer: megaadmin <megaadmin@myhost>
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly
...

but if you use vs code, you might get a message like

vs code git error message about configure git username

How

Basically what we need to do is to run git with configure command:

git config user.email "root@microsoft.com"
git config user.name "bg"

Just replace email and username with yours.