To set global username/email configuration in git config:

Set user name:

Syntax:

git config --global user.name "<name>"

Example:

$ git config --global user.name "First Name Last Name"

Set user email address:

Syntax:

git config --global user.email "<email-address>"

Example:

$ git config --global user.email "name@example.com"

To set repository-specific username/email configuration in git config:

From the command line, change into the repository directory.

Set user name:

Syntax:

git config user.name "<name>"

Example:

$ git config user.name "First Name Last Name"

Set user email address:

Syntax:

git config user.email "<email-address>"

Example:

$ git config user.email "name@example.com"

To verify configuration, open the configuration file:

$ git config --global user.name // Global

Output: It will print the name

$ git config user.name // Repository Specific

Output: It will print the name
$ git config --global user.email // Global

Output: It will print the email address

$ git config user.email // Repository Specific

Output: It will print the email address