Configure Git User Information On macOS:
To configure your Git user information on macOS, follow these steps:
$ git config --global user.name "John Doe"
$ git config --global user.email "email@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.
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.
git config --list to 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 "firstname.lastname@example.org"
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.