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)
- 1
Install Git — git --version to verify. Download from git-scm.com if missing.
- 2
Install VS Code — Add extensions: GitLens, Java Extension Pack, Live Server.
- 3
Install IntelliJ IDEA Community — Free. Smarter Java autocomplete than VS Code.
- 4
Create a GitHub account at github.com — use your real name. This is your developer portfolio.
🧠 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)
- Create a folder
my-portfolio on your desktop
- Run
git init inside it
- Create
README.md — write your name and 3 goals for this internship
- Run
git add . then git commit -m "first commit"
- Create a new repo on GitHub named
my-portfolio
- Push:
git remote add origin <url> then git push -u origin main
- 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 init | New repo |
| git clone <url> | Copy repo |
Daily Workflow
| git pull | Get latest |
| git add . | Stage all |
| git commit -m "msg" | Save snapshot |
| git push | Upload |
Branching
| git checkout -b name | Create + switch |
| git checkout main | Back to main |
| git merge name | Merge branch |
| git branch -d name | Delete branch |
Inspect
| git status | What changed |
| git log --oneline | History |
| git diff | Line changes |
| git stash | Save dirty work |
VS Code Shortcuts
| Ctrl + P | Open file |
| Ctrl + ` | Terminal |
| Ctrl + Shift + P | Command palette |
| Ctrl + / | Toggle comment |
Good Commit Messages
| add login form | ✅ Clear |
| fix null pointer in UserService | ✅ Specific |
| update stuff | ❌ Vague |
| asdfgh | ❌ Useless |