0–5 min
Real Hook
5–20 min
Git Concepts
20–40 min
Live Demo
40–55 min
You Code It
55–60 min
Cheat Sheet
🔥 Real-World Hook (0–5 min)

Imagine 5 developers all editing the same App.java on WhatsApp. Priya adds login. Ravi adds payment. Ravi sends his file to Priya. She overwrites it. Ravi's payment feature is gone forever.

This happened at a startup in 2019 — they lost 3 weeks of work. Git is the solution. It's a time machine for your code. Every tech company — Google, Infosys, Zoho — uses it on Day 1.

⚙️ Quick Setup (5 min)

🧠 Git — The 3 Zones (5–20 min)

💡 Analogy — Git is like a Photo Album

Working Directory = You're clicking photos right now (editing files).
Staging Area = You selected the best photos to print (git add).
Repository = The photos are printed and in the album forever (git commit).
GitHub = You shared the album online (git push).

# One-time setup
git config --global user.name  "Your Name"
git config --global user.email "you@gmail.com"

# Start a new project
git init                        # create .git folder
git clone https://github.com/x  # copy an existing repo

# Daily workflow — ALWAYS these 3 steps
git add .                       # stage all changes
git commit -m "add login form"  # save snapshot
git push origin main            # upload to GitHub

# Before you start coding each day
git pull                        # get teammate's latest changes

🌿 Branching — Work Without Fear (20–40 min)

🌍 Real Example — Feature Branch

At Flipkart, no one codes directly on main. They create a branch like feature/add-cart-button, code there, then merge. If something breaks, main is always safe.

# Create and switch to a new branch
git checkout -b feature/login-page

# Code your feature, then commit
git add .
git commit -m "add login form UI"

# Merge back to main when done
git checkout main
git merge feature/login-page

# Useful inspection commands
git status          # what changed?
git log --oneline   # history in one line each
git diff            # exact line changes

🚫 .gitignore — What NOT to commit

⚠️ Never commit these

API keys, passwords, .env files — once pushed to GitHub (even if deleted later), they are compromised forever. Google has bots scanning GitHub for leaked keys.

# .gitignore file in your project root
.env
*.log
target/
node_modules/
.idea/
*.class
🎯 You Code It (40–55 min)
  1. Create a folder my-portfolio on your desktop
  2. Run git init inside it
  3. Create README.md — write your name and 3 goals for this internship
  4. Run git add . then git commit -m "first commit"
  5. Create a new repo on GitHub named my-portfolio
  6. Push: git remote add origin <url> then git push -u origin main
  7. Goal: Show the instructor your GitHub repo URL

📄 Day 1 Cheat Sheet — Git & Dev Tools

Setup Once

git config --global user.name "X"Set name
git config --global user.email "x"Set email
git initNew repo
git clone <url>Copy repo

Daily Workflow

git pullGet latest
git add .Stage all
git commit -m "msg"Save snapshot
git pushUpload

Branching

git checkout -b nameCreate + switch
git checkout mainBack to main
git merge nameMerge branch
git branch -d nameDelete branch

Inspect

git statusWhat changed
git log --onelineHistory
git diffLine changes
git stashSave dirty work

VS Code Shortcuts

Ctrl + POpen file
Ctrl + `Terminal
Ctrl + Shift + PCommand palette
Ctrl + /Toggle comment

Good Commit Messages

add login form✅ Clear
fix null pointer in UserService✅ Specific
update stuff❌ Vague
asdfgh❌ Useless