To change the Git user name and email, you can use the following commands in your Git command line or terminal:
- Open your Git command line or terminal.
- Navigate to the repository for which you want to change the user name and email.
- To change the user name, use the following command:
Replace "Your New Name" with the desired user name you want to use.git config user.name "Your New Name"
- To change the user email, use the following command:
Replace "yournewemail@example.com" with the desired email address you want to use.git config user.email "yournewemail@example.com"
- Verify that the changes have been applied by running the following command:
This command will list all the Git configurations, including your updated user name and email.git config --list
Note: If you want to change the user name and email globally for all your Git repositories, you can add the --global
flag to the git config
commands. For example:
git config --global user.name "Your New Name"
git config --global user.email "yournewemail@example.com"
That's it! Your Git user name and email should now be updated.