Git User Config

Git provides the user-related configurations like username or user email etc. This configuration can be set on different levels like user level or global level. In this tutorial, we examine how to display the username or user email configurations via the command line interface.

Display User Configuration

The current configuration of the user for the git can be listed by using the git config command. The --list parameter is provided to this command.

$ git config --list

Set User Name

User names are used to set information about the contributor name. The user.name is used to set the user name of the contributor. The git config user.name is used to set the user name.

$ git config user.name='İsmail Baydan'

If we want to set the user name globally which will be used for other repositories the --global option should be used like below.

$ git config --global user.name='İsmail Baydan'

Set User Email

The user email address can be also set with the following command.

$ git config user.email='ibaydan@wisetut.com'

If we want to set the user email globally which will be used for other repositories the --global option should be used like below.

Set User Text Editor

The text editor is used to make edits during commits. The user text editor can be set by using the core.editor option like below.

$ git config core.editor='nano'

This configuration can be set globally like below.

$ git config --global core.editor='nano'

Leave a Comment