How to set Git config values?

QuestionsQuestions8 SkillsProGit Config ManagementOct, 15 2025
0106

You can set Git configuration values using the git config command. There are three levels at which you can set configuration values: local, global, and system.

  1. Local Configuration (specific to the repository):

    git config --local <key> <value>
  2. Global Configuration (for the current user across all repositories):

    git config --global <key> <value>
  3. System Configuration (for all users on the system):

    git config --system <key> <value>

Examples:

  • To set the user name globally:

    git config --global user.name "Your Name"
  • To set the user email locally for a specific repository:

    git config --local user.email "your.email@example.com"
  • To set the default text editor globally:

    git config --global core.editor "nano"

You can also view all configurations using:

git config --list

0 Comments

no data
Be the first to share your comment!