Installing Git
Git is a version control system — software that tracks changes to your code over time.
What is Git?
The Problem Git Solves:
Without version control:my_project/├── index.html├── index_v2.html├── index_v2_final.html├── index_v2_final_REALLY_FINAL.html├── index_backup_before_changes.html├── index_old_dont_delete.html└── 😱 With Git:my_project/└── index.html ← Always the current version └── (Git remembers EVERY previous version automatically)Git Is Like:
| Analogy | How It Relates |
|---|---|
| Unlimited Undo | Go back to any previous version |
| Save Game | Create checkpoints you can return to |
| Time Machine | Travel to any point in your project's history |
| Insurance | Never lose work again |
Why Every Developer Uses Git
Reason 1: Safety Net
Made a mistake? Go back to when it worked.
Reason 2: Experimentation
Try crazy ideas. If they fail, undo. If they work, keep them.
Reason 3: Collaboration
Multiple people can work on the same project without conflicts.
Reason 4: Professional Requirement
Every tech company uses Git. It's not optional in the industry.
Reason 5: GitHub
GitHub (website for sharing code) requires Git. Open source, portfolios, and collaboration all happen there.
Installation Instructions
Choose your operating system:
# Windows Installation ## Step 1: Download1. Open your browser2. Go to: git-scm.com3. Click "Download for Windows"4. The installer will download automatically ## Step 2: Run Installer1. Find and run the downloaded file2. Click through the installer with these important choices: Select Components:- Keep defaults selected Choosing the default editor:- Choose "Use Visual Studio Code as Git's default editor" Adjusting PATH: ⚠️ IMPORTANT- Choose "Git from the command line and also from 3rd-party software" HTTPS transport backend:- Choose "Use the OpenSSL library" Line ending conversions:- Choose "Checkout Windows-style, commit Unix-style line endings" Terminal emulator:- Choose "Use Windows' default console window" Other options:- Keep defaults for remaining screens 3. Click Install4. Click Finish ## Step 3: Restart VS CodeClose and reopen VS Code for changes to take effect.Verification
Check Git Version:
Open VS Code Terminal (Ctrl/Cmd + `) and run:
git --versionExpected output:
git version 2.43.0
Version number may vary — any response means success!
Initial Configuration
Git needs to know who you are (for tracking who made changes).
Configure Your Name:
git config --global user.name "Your Name"Replace "Your Name" with your actual name.
Example:
git config --global user.name "Alex Johnson"Configure Your Email:
git config --global user.email "your.email@example.com"Use an email you'll remember — ideally the same one you'll use for GitHub later.
Example:
git config --global user.email "alex.johnson@gmail.com"Verify Configuration:
git config --global --listExpected output:
user.name=Alex Johnson
user.email=alex.johnson@gmail.com
Optional: Set Default Editor
Tell Git to use VS Code for any text editing:
git config --global core.editor "code --wait"Configuration Checklist
✅ Git Installation Verification
0/4Troubleshooting
What You Can Do Now
With Git installed, you can:
1. Initialize a repository:
git init2. Track changes:
git add .git commit -m "Description of changes"3. See history:
git log4. Connect to GitHub (coming in Module 3!)
We'll learn these commands in detail later. For now, just know Git is ready!
Git Concepts Preview
Here's what you'll learn to use:
| Term | What It Means |
|---|---|
| Repository (Repo) | A project tracked by Git |
| Commit | A saved checkpoint |
| Branch | A parallel version for experiments |
| Push | Upload changes to GitHub |
| Pull | Download changes from GitHub |
| Clone | Copy a repo to your computer |
Don't worry about memorizing these now — you'll learn by doing!
Lesson Summary
What You Accomplished:
- ✅ Understand what Git is (version control)
- ✅ Installed Git on your computer
- ✅ Configured name and email
- ✅ Verified installation
Why This Matters
Git is non-negotiable in professional development. Every serious project uses it, and GitHub requires it.
The Big Picture:
VS Code → Where you write codeNode.js → Runs your JavaScriptGit → Tracks your changesGitHub → Shares and backs up your code (coming in Module 3)Knowledge Check
📝 Quiz
1/2What is Git?
Next Up
Let's verify your entire setup is working correctly with a complete environment check!