CodeBlanks Logo Icon CodeBlanks

git config

Learn to view settings with git config.

The git config command

You manage Git's behavior and identity information using the git config command. To view all existing configuration settings in the terminal, the --list parameter is used.

git config --list

This command lists all defined settings, such as user name and email, line by line.

Reading a specific setting

Instead of scanning the whole list, you may want to check the value of a single setting. To do this, simply write the setting key after the git config command.

git config user.name

This command prints only the value corresponding to the specified key to the screen.

Practice Query user name

Run the git config user.name command to display the preconfigured user name.

Starter code

terminal
git config user.name "Deniz"
# user.name ayarını ekrana yazdır

Sample solution

terminal
git config user.name "Deniz"
git config user.name

Expected output

Deniz

Questions and answers

Review the lesson questions together with their answers. To test yourself, solve the lesson interactively.

1 Which command is used to list all configuration settings stored in Git?

  • git config --show
  • git config --view
  • git config --list Correct answer
  • git config --all

Explanation: To view all saved settings in Git, the `git config --list` command is used.

2 List all settings

Question
git config ____
Answer
git config --list

Explanation: `git config --list` lists all Git configuration settings in the repository and system.

3 Core concepts

Term Meaning
git config Manages Git settings
--list Lists all settings
user.name Stores user name
user.email Stores email address

All lessons in Beginner