In this lesson, you will learn how to inspect your Git configuration to ensure your identity and preferences are saved exactly as you intended.
Why Verification Matters
When you set up your user identity and environment settings, you are essentially creating the "Git profile" that will be attached to every piece of work you contribute. Because Git relies on these settings to attribute your code to you, it is vital to verify that no typos exist and that your preferences are active. Instead of relying on guesswork, Git provides a simple command to pull back the curtain and show you exactly what is stored in your configuration files.
Inspecting Your Settings
The most direct way to check your current configuration is using the git config command with the --list flag. This command tells Git to print out every setting it currently has on record for your machine:
git config --list
When you run this, you will see a list of key-value pairs. Look through the output for the lines starting with user.name and user.email. This is the signature that will appear on your commits. If you see your name and email address correctly displayed, you are ready to go.
Viewing the File Directly
If you want to see exactly where these settings are living on your computer, you can ask Git to show you the location of the file:
git config --list --show-origin
This command prints the path to your configuration file (usually a file named .gitconfig in your user home directory) next to each setting. This is incredibly useful if you ever find yourself wondering which file is overriding your preferences.
If you ever notice a mistake in your settings—like a misspelled email address—you can simply re-run the configuration commands from previous lessons to overwrite the incorrect value. Git will automatically update the file with your new, corrected input. By making a habit of checking these settings, you ensure that your identity remains consistent and professional across all your projects.
Key Takeaway: Use git config --list to confirm that your identity and environment settings are accurately stored before you begin your first project.