Day 1: Introduction to Git – Your Personal Time Machine for Code
Module 1: What is Git and Why Do We Need It?
- Understanding the Problem Git Solves
- Real-life example: Writing a group report and losing track of who made what change
- Manual backups vs. version control
- What is Git?
- Git as a version control system (VCS)
- Git vs. Google Docs: offline, code-focused, and structured
Module 2: Setting Up Git
- Installing Git on your system
- Hands-on: Walkthrough on Windows/Mac/Linux
- Initial Setup
- Configuring name and email:
git config --global user.name "Your Name"
git config --global user.email "[email protected]"
- Real-life analogy: Like registering your ID before checking out library books
Module 3: Initializing and Understanding Git Repositories
- What is a repository?
- Real-life example: Think of a repo as a folder with a memory
- Creating your first repo
git init
- Hands-on: Create a folder and initialize Git inside it
- Checking status
git status
- Visualizing changes (tracked vs untracked)
Module 4: Saving Your Work with Commits
- The staging area
- Real-life example: Like adding groceries to a cart before checkout
- Commands to stage and commit
git add filename or git add .
git commit -m "Your message"
- Good commit messages
- Analogy: Writing clear to-do notes for your future self
- Hands-on: Add and commit a sample text file
Module 5: Tracking History and Going Back
- Viewing your commit history
- Undoing changes and restoring previous versions
git checkout, git restore, git reset (basic usage)
- Analogy: Rewinding your Netflix show to an earlier scene