Display Git Configuration with “git config –list” Command

Git provides different configurations like user name, user email, editor, coloring, etc. These configurations can be also set in different modes called global, user, and local. The git config --list command is used to print all of these different types or levels of configurations in the command-line interface.

List Git Configuration

The current git configuration can be listed with the following git config --list like below.

$ git config --list

List System Git Configuration

System-wide git configuration can be listed with the --system option. The system-wide configuration is located inside /etc/gitconfig file.

$ git config --list --system

List Global Git Configuration

Global git configuration is used for the current user. The global git configuration is located inside ~/.gitconfig which is under the current user home directory.

$ git config --list --global

List Local Git Configuration

The local git configuration is used for a specific git repository. A user may have multiple git repositories. So in order to list local git configuration for a specific repository the command should be executed inside the repository. For example, is the repository is located at /home/ismail/nmap we should navigate using cd command.

$ cd /home/ismail/nmap

$ git config --list --local

Leave a Comment