How to Setup Commit Username and Email for Git

Channel: Linux
Abstract: $ git config --global user.email "[email protected]"$ git config user.email "[email protected]"

Git client added an identity to each commit. For this Git uses an username and email address to associate with the commit. This name and email change will apply for future commits only.

Setup git username for a single repository

Open Terminal and use the following commands to set Git username and email address for your current git repository.

Set a Git username:

$ git config user.name "Den Smith"

Set a Git email:

$ git config user.email "[email protected]"
Setup git username for all repositories

Use --global option to set username and email globally on system. Open a terminal and use the following commands to set Git username and email address for all the git repository on the system.

Set a Git username:

$ git config --global user.name "Den Smith"

Set a Git email:

$ git config --global user.email "[email protected]"

Ref From: tecadmin
Channels: git

Related articles