If you want to update git user.name, user.email, or any other configuration please follow the below steps.
Update git system configuration options:
Option 1: Directly edit the git config file
1 2 3 4 5 6 7 |
## Execute below command to open your git system config file in default editor git config --system --edit ## Update and save the file ## Check if system config was updated successfully git config --system --list |
Option 2: Update individual configuration key values:
1 2 3 4 5 6 7 8 9 |
## Update individual git config git config --system --replace-all ## for example to update your git user.name and user.email on system configuration git config --system --replace-all user.name new_user_name git config --system --replace-all user.email new_user_email ## Check if system config was updated successfully git config --system --list |
Update git global configuration options:
Option 1: Directly edit the git config file
1 2 3 4 5 6 7 |
## Execute below command to open your git global config file in default editor git config --global --edit ## Update and save the file ## Check if global config was updated successfully git config --global --list |
Option 2: Update individual configuration key values:
1 2 3 4 5 6 7 8 9 |
## Update individual git config git config --global --replace-all ## for example to update your git user.name and user.email on global configuration git config --global --replace-all user.name new_user_name git config --global --replace-all user.email new_user_email ## Check if global config was updated successfully git config --global --list |
Update git local configuration options:
Option 1: Directly edit the git config file
1 2 3 4 5 6 7 |
## Execute below command to open your git local config file in default editor git config --local --edit ## Update and save the file ## Check if local config was updated successfully git config --local --list |
Option 2: Update individual configuration key values:
1 2 3 4 5 6 7 8 9 |
## Update individual git config git config --local --replace-all ## for example to update your git user.name and user.email on local configuration git config --local --replace-all user.name new_user_name git config --local --replace-all user.email new_user_email ## Check if local config was updated successfully git config --local --list |