Installing and Configuring Git
You'll learn: How to get Git running on your machine and set up your identity so every change you make is properly attributed to you.
Why Configuration Matters
Think of Git configuration like setting up your driver's license before you can legally drive. Git needs to know who you are so that every snapshot (commit) you create is tagged with your name and email. Without this setup, Git won't let you save your work properly.
Installation
Installing Git is straightforward:
- Windows: Download the installer from git-scm.com and run it
- Mac: Install via Homebrew (
brew install git) or download from git-scm.com - Linux: Use your package manager (e.g.,
sudo apt-get install git)
After installation, open your terminal or command prompt and verify with git --version.
Essential Configuration
Once installed, configure your identity globally (for all projects on your machine):
git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"
These commands tell Git who you are. Every commit you make will include this information, creating an audit trail—crucial when working with teams or reviewing your own history months later.
You can also set your preferred text editor for commit messages:
git config --global core.editor "code --wait"
(This example sets VS Code; adjust for your editor.)
Checking Your Configuration
View all your settings anytime with:
git config --list
Key Takeaway: Installing and configuring Git with your name and email is essential setup work—it ensures every change you track is properly attributed to you, forming the foundation for professional version control and collaboration.