
Your First Git Configuration: User Name and Email
Before you start making commits, Git needs to know who you are. Every commit you make will be associated with your name and email address. This is crucial for tracking contributions and identifying authors of changes. Think of it like putting your signature on your work, but for code!
You can configure your user name and email globally (for all your Git projects on your machine) or locally (for a specific project). For beginners, setting it globally is usually the easiest and most practical approach.
To set your user name globally, open your terminal or command prompt and run the following command, replacing "Your Name" with your actual name:
git config --global user.name "Your Name"Similarly, to set your email address globally, use this command, replacing "your.email@example.com" with your actual email address:
git config --global user.email "your.email@example.com"It's a good practice to use the same email address you use for your GitHub account, as this will help link your local contributions to your online profile.
You can verify your settings at any time by running these commands: