Change Username and Email for Single Repository

Git command line utility allowed to us to configure identity for your Git repository. Git keeps all the repository specific configurations under the “.git” directory. The conflagration’s are keep under .git/config file. To configure git username and email address for the repository, first switch to the repository directory. Then configure Git username and email address with the following commands: Make sure to change name and email address with your details. Next run the following command to view the changes are properly updated to your repository:

Setup Username & Email Globally

The above section describes you the configuration of git username and email address for single repository. If you have multiple repository on your system and you don’t want to configure username and email address for each repository individually. You can use –global option with that commands to configure it globally, which will be available for all repositories of that system user. Run the following commands to set Git username and email address for user: The Global configurations are stored in ~/.gitconfig file. You can edit this file and view the details. Run the same command to view the changes: Note: The username and email address configuration of specific repository, will overwrite the global configuration.