📘 COURSE OVERVIEW
This course gives you a rock-solid foundation in:
- Git (local version control)
- GitHub (remote collaboration)
- Real-world workflows (branching, merging, collaboration)
Git = tracks changes locally
GitHub = cloud platform for collaboration
🧩 MODULE 1: WHAT IS GIT?
🔹 Definition
Git is a Version Control System (VCS) that:
- Tracks every change in your files
- Stores history (who, when, what changed)
- Allows rollback to previous versions
🔹 Key Features
- Tracks any file type (code, text, images, videos)
- Maintains multiple versions
- Enables safe experimentation
🔹 Real-world Problem Git Solves
You:
- Build a project → client likes it
- Update it → client wants old version
👉 Without Git → you're stuck
👉 With Git → you restore instantly
🔗 MODULE 2: GIT vs GITHUB
🔹 Git
- Local tool
- Runs on your computer
🔹 GitHub
- Cloud platform
- Stores repositories online
- Enables collaboration
🔹 Analogy
- Git = coffee ☕
- GitHub = coffee shop 🏪
🔹 Alternatives
- GitLab
- Bitbucket
🏗️ MODULE 3: GIT ARCHITECTURE
🔹 Two Parts
- Local
- Remote (GitHub)
🔹 Workflow Stages
- Working Directory
- Where you edit files
- Staging Area
- Temporary holding area
- Repository
- Permanent storage (commit history)
🔁 Workflow Summary
Working Directory → Staging Area → Local Repo → Remote Repo
⚙️ MODULE 4: INSTALLING GIT
🔹 Steps
- Go to official Git website
- Download for:
- Windows (32/64-bit)
- Mac (Homebrew)
- Linux
🔹 Verify Installation
git --version
✔ If installed → shows version
❌ Else → error
💻 MODULE 5: TERMINAL BASICS
🔹 Important Commands (NOT Git commands)
cd # change directory
pwd # show current path
mkdir # create folder
touch # create file
ls # list files
📁 MODULE 6: CREATING A PROJECT
🔹 Steps
cd Desktop
mkdir git-1
cd git-1
touch 1.txt
touch 2.txt
mkdir my-folder
cd my-folder
touch 3.txt
🚀 MODULE 7: INITIALIZING GIT
🔹 Command
git init
🔹 What Happens
- Creates hidden
.gitfolder - Git starts tracking project
ls -la
👉 Shows .git folder
🌐 MODULE 8: GITHUB REPOSITORY
🔹 Steps
- Go to GitHub
- Create new repo
- Add files online
- Commit changes
📥 MODULE 9: CLONING A REPO
🔹 Command
git clone <repo-url>
🔹 Result
- Downloads remote repo
- Creates local copy
🔍 MODULE 10: TRACKING CHANGES
🔹 Command
git status
🔹 Shows:
- Modified files
- New files
- Deleted files
📦 MODULE 11: STAGING (git add)
🔹 Purpose
Move changes → staging area
🔹 Variations
1. Add everything
git add --all
git add -A
2. Add current directory
git add .
3. Add specific file
git add file.txt
4. Add by extension
git add *.txt
5. Add using wildcard
git add *
⚠️ Does NOT include deleted files
🔄 MODULE 12: UNSTAGING
🔹 Command
git reset
👉 Moves files back to working directory
💾 MODULE 13: COMMITTING
🔹 Command
git commit -m "message"
🔹 Meaning
- Permanently saves changes
⚠️ First-time Setup
git config --global user.email "you@email.com"
git config --global user.name "Your Name"
⏪ MODULE 14: UNDO COMMITS
git reset HEAD~
👉 Undo last commit
❌ MODULE 15: DELETING FILES
🔹 Delete + stage
git rm file.txt
🔹 Force delete
git rm -f file.txt
🔹 Remove from Git only
git rm --cached file.txt
📜 MODULE 16: VIEW HISTORY
git log
Short version:
git log --oneline
🌿 MODULE 17: BRANCHING
🔹 Create branch
git branch development
🔹 View branches
git branch
🔹 Switch branch
git checkout development
🔹 Concept
- Main = stable code
- Branch = experimentation
🔀 MODULE 18: MERGING
🔹 Merge branch
git merge development
⚠️ MODULE 19: MERGE CONFLICTS
Occurs when:
- Same file edited in different branches
🔹 Resolution Steps
- Open file
- Choose correct version
- Remove conflict markers
- Commit
⏳ MODULE 20: TIME TRAVEL
🔹 Go to old commit
git checkout <commit-id>
🔹 Return to latest
git checkout main
🔍 MODULE 21: COMPARE CHANGES
git diff <commit1> <commit2>
- Red → removed
- Green → added
☁️ MODULE 22: REMOTE OPERATIONS
🔹 Push
git push origin main
🔹 Fetch
git fetch
🔹 Pull
git pull
🔁 Summary
- push → local → remote
- fetch → remote → local (no merge)
- pull → fetch + merge
🔄 MODULE 23: RESTORE
🔹 Undo changes
git restore file.txt
🔹 Restore all
git restore .
🔹 Unstage
git restore --staged file.txt
📦 MODULE 24: STASH
🔹 Save unfinished work
git stash
🔹 Retrieve later
git stash apply
🧠 FINAL SUMMARY
You now understand:
- Git fundamentals
- Local vs remote workflow
- Full command lifecycle
- Branching & collaboration
- Conflict resolution
- Undoing mistakes safely
Top comments (0)