
On this page
How to change git username & password after you change the git password.
When working with Git, every commit you make is tagged with a username and email address. This information helps identify who made changes to the code and is especially important when collaborating on projects or pushing code to remote repositories like GitHub or GitLab.
Before you start committing, it’s a good practice to configure your Git user information correctly on your system. In this guide, we’ll walk through how to set up your Git username and email on both macOS and Windows, including options for global and repository-specific configurations, so your commits always reflect the right identity.
To configure your Git user information on macOS, follow these steps:
git config --global user.name "John Doe"
git config --global user.email "john@example.com"
Don’t forget to change the user name and email to your desired values. This configuration is global for your Git installation.
If you’re using macOS and wish to store your password in the keychain, Git should automatically prompt you to store your credentials when needed.
On Windows:
To configure your Git user information on Windows, you can use the following commands:
- Navigate to the repository where you want to make the changes in your terminal.
- Execute
git config --listto check the current username and email in your local repository. - Change the username and email as desired, and you can choose whether to make it a global change or specific to the local repository:
git config [--global] user.name "Full Name" git config [--global] user.email "email@address.com"
You can also edit the .git/config file manually on a per-repository basis if you prefer. This allows you to customize configuration settings for a specific repository.
By following these steps, you can easily configure your Git user information on macOS and Windows, ensuring that your commits are associated with the correct name and email address.
- END -



