git config
- Git course
- Beginner
- Lesson 13/80
- 4 min
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 --listThis 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.nameThis 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
git config user.name "Deniz"
# user.name ayarını ekrana yazdırSample solution
git config user.name "Deniz"
git config user.nameExpected 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
git config ____
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 |