Git Configuration Guide
After installing Git, the first step is to introduce yourself to the version control system. These settings are embedded into every commit you make.
1. Prerequisites
Ensure Git is installed on your system.
- Reference: Post-Install Linux Configuration
2. Identity Setup
Git needs to know who you are to attribute changes to you.
-
Set your Name:
git config --global user.name "Your Name" -
Set your Email:
- Note: This should match the email used for your GitHub/GitLab account.
git config --global user.email "your.email@example.com"
- Note: This should match the email used for your GitHub/GitLab account.
3. Default Branch Configuration
Historically, Git used master as the default branch name. Modern best practices and platforms like GitHub now use main.
- Set default branch to
main:git config --global init.defaultBranch main
4. Verification
To confirm your settings are applied correctly:
- Run the list command:
git config --list - Expected Output:
user.name=Your Name user.email=your.email@example.com init.defaultbranch=main