2. Installing Git & First Configuration
Installing Git & First Configuration
Before any Git work, you need Git installed and configured with your identity. Every commit you make will be permanently tagged with your name and email. This is not optional.
📦 Installation
macOS (using Homebrew):
Ubuntu / Debian Linux:
Windows: Download Git for Windows. This includes Git Bash, a Unix-style terminal for Windows.
Verify installation (Expected output: git version 2.44.0):
🔧 Essential First Configuration
Run these three commands immediately after installing Git. You only need to do this once per machine. This identity is attached to every commit you make.
Set your full name (as it will appear on every commit):
Set your email (use the same one as your GitHub account):
Set VS Code as your default editor for commit messages:
Verify your configuration:
🔑 SSH Key Setup — Authenticate Without Passwords
SSH keys let you push to GitHub without typing a password every time. Generate them once and forget about authentication forever. Press Enter to accept defaults at all prompts during generation:
Copy the PUBLIC key to your clipboard.
macOS:
Linux:
Then copy the output. Next, go to: GitHub → Settings → SSH Keys → New SSH Key. Paste and save. You're done — no more passwords.
Test the connection (Expected: Hi username! You've successfully authenticated.):
Knowledge Check
Ready to test your understanding of 2. Installing Git & First Configuration?