Programmer’s Picnic

GitHub Mastery Series

By Champak Roy

GitHub Day 1 — Exact Commands (Beginner Class)

Goal: First repo + first push Level: Absolute Beginner Time: 60–75 minutes

✅ What students will learn today

  • Git vs GitHub (in 2 minutes)
  • Repository, commit, and history
  • The “daily workflow” commands
  • Push local code to GitHub
Teacher line (say this)

“Today you’ll stop coding like a beginner and start working like a professional — because your code will now have history.”

🟠 The exact commands (execute in this order)

Open Terminal / Git Bash / VS Code Terminal and type these commands exactly.

Step 0 — Check Git
git --version
Step 1 — Configure Git (one-time)
git config --global user.name "Your Name"
git config --global user.email "your@email.com"
git config --list
Step 2 — Create project folder
mkdir pp-day1
cd pp-day1
Step 3 — Initialize Git
git init
Step 4 — Create a file (Windows)
echo Hello GitHub > index.html
Step 4 — Create a file (Mac/Linux)
touch index.html
Step 5 — Status
git status
Step 6 — Add to staging
git add index.html
# OR (all files)
git add .
Step 7 — Commit
git commit -m "Initial commit"
Step 8 — Do this on GitHub website

Create a repository named pp-day1 and do NOT create README on GitHub for this repo. Copy the repository URL.

Step 9 — Connect to GitHub
git remote add origin https://github.com/username/pp-day1.git
git remote -v
Step 10 — Push to GitHub
git branch -M main
git push -u origin main

🔁 One more cycle (so they “get it”)

Now students will change the file again, commit again, and push again.

Modify → status → add → commit → push
echo Learning Git is powerful >> index.html
git status
git add .
git commit -m "Updated index file"
git push
What students must memorize

git statusgit add .git commit -m "msg"git push

🧯 Common errors (and quick fixes)

1) “Author identity unknown”

Fix by configuring your name/email:

Fix
git config --global user.name "Your Name"
git config --global user.email "your@email.com"
2) “remote origin already exists”

Fix by removing and adding again:

Fix
git remote remove origin
git remote add origin https://github.com/username/pp-day1.git