Git Config
What
The git config command allows you to customize how your local and global Git environments behave by setting various configuration parameters.
How
The modern git config syntax uses the set subcommand to write values. You can define variables in a section.key hierarchical format:
# General syntax
git config set [--global|--local] <section>.<key> "<value>"
# Example: Setting global author name
git config set --global user.name "John Doe"
# Example: Setting local project-specific configurations (within a repo)
git config set webflyx.ceo "Warren"
To list all configured settings for your local project:
# List all active config options in the current repository
git config list --local
# Inspect the raw local configuration file directly
cat .git/config
Note: In older versions of Git (pre-2.46.0), subcommands were formatted as flags (e.g., git config --global user.name "..."). The modern set syntax is now preferred to avoid deprecation warnings.
Why
Configurability is a key strength of Git. Almost every aspect of Git—from merge behaviors and default branch names to custom text editors and alias abbreviations—can be adjusted to fit your personal workflow or project requirements.
Summary
Use git config set to define and modify configuration parameters inside your global or project-specific Git setup.