What is git config?

The git config command lets you set Git configuration values such as your username, email, editor, and more.

Set Username and Email

git config --global user.name "Your Name"
git config --global user.email "you@example.com"

Use --global to apply these settings to all Git repositories.

Check Configuration

To check your Git config settings, run:

git config --list

Set Default Editor

Set your preferred text editor (example using VS Code):

git config --global core.editor "code --wait"

Local vs Global vs System

  • --system: Applies to every user and repo on the system.
  • --global: Applies to the current user.
  • --local: Applies to the current repo (default if none specified).