DEV Community

Ikegbo Ogochukwu
Ikegbo Ogochukwu

Posted on

COMPLETE COURSE: Git & GitHub (From Zero to Advanced)

📘 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

  1. Local
  2. Remote (GitHub)

🔹 Workflow Stages

  1. Working Directory
  • Where you edit files
  1. Staging Area
  • Temporary holding area
  1. Repository
  • Permanent storage (commit history)

🔁 Workflow Summary

Working Directory → Staging Area → Local Repo → Remote Repo
📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน 📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน

⚙️ MODULE 4: INSTALLING GIT

🔹 Steps

  1. Go to official Git website
  2. Download for:
  • Windows (32/64-bit)
  • Mac (Homebrew)
  • Linux

🔹 Verify Installation

git --version
📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน 📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน

✔ 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
📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน 📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน

📁 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
📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน 📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน

🚀 MODULE 7: INITIALIZING GIT

🔹 Command

git init
📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน 📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน

🔹 What Happens

  • Creates hidden .git folder
  • Git starts tracking project
ls -la
📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน 📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน

👉 Shows .git folder


🌐 MODULE 8: GITHUB REPOSITORY

🔹 Steps

  1. Go to GitHub
  2. Create new repo
  3. Add files online
  4. Commit changes

📥 MODULE 9: CLONING A REPO

🔹 Command

git clone <repo-url>
📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน 📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน

🔹 Result

  • Downloads remote repo
  • Creates local copy

🔍 MODULE 10: TRACKING CHANGES

🔹 Command

git status
📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน 📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน

🔹 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
📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน 📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน

2. Add current directory

git add .
📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน 📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน

3. Add specific file

git add file.txt
📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน 📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน

4. Add by extension

git add *.txt
📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน 📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน

5. Add using wildcard

git add *
📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน 📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน

⚠️ Does NOT include deleted files


🔄 MODULE 12: UNSTAGING

🔹 Command

git reset
📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน 📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน

👉 Moves files back to working directory


💾 MODULE 13: COMMITTING

🔹 Command

git commit -m "message"
📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน 📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน

🔹 Meaning

  • Permanently saves changes

⚠️ First-time Setup

git config --global user.email "you@email.com"
git config --global user.name "Your Name"
📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน 📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน

⏪ MODULE 14: UNDO COMMITS

git reset HEAD~
📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน 📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน

👉 Undo last commit


❌ MODULE 15: DELETING FILES

🔹 Delete + stage

git rm file.txt
📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน 📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน

🔹 Force delete

git rm -f file.txt
📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน 📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน

🔹 Remove from Git only

git rm --cached file.txt
📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน 📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน

📜 MODULE 16: VIEW HISTORY

git log
📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน 📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน

Short version:

git log --oneline
📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน 📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน

🌿 MODULE 17: BRANCHING

🔹 Create branch

git branch development
📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน 📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน

🔹 View branches

git branch
📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน 📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน

🔹 Switch branch

git checkout development
📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน 📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน

🔹 Concept

  • Main = stable code
  • Branch = experimentation

🔀 MODULE 18: MERGING

🔹 Merge branch

git merge development
📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน 📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน

⚠️ MODULE 19: MERGE CONFLICTS

Occurs when:

  • Same file edited in different branches

🔹 Resolution Steps

  1. Open file
  2. Choose correct version
  3. Remove conflict markers
  4. Commit

⏳ MODULE 20: TIME TRAVEL

🔹 Go to old commit

git checkout <commit-id>
📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน 📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน

🔹 Return to latest

git checkout main
📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน 📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน

🔍 MODULE 21: COMPARE CHANGES

git diff <commit1> <commit2>
📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน 📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน
  • Red → removed
  • Green → added

☁️ MODULE 22: REMOTE OPERATIONS

🔹 Push

git push origin main
📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน 📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน

🔹 Fetch

git fetch
📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน 📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน

🔹 Pull

git pull
📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน 📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน

🔁 Summary

  • push → local → remote
  • fetch → remote → local (no merge)
  • pull → fetch + merge

🔄 MODULE 23: RESTORE

🔹 Undo changes

git restore file.txt
📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน 📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน

🔹 Restore all

git restore .
📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน 📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน

🔹 Unstage

git restore --staged file.txt
📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน 📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน

📦 MODULE 24: STASH

🔹 Save unfinished work

git stash
📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน 📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน

🔹 Retrieve later

git stash apply
📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน 📢 แจ้งเตือน: kenryikegbo/complete course git github from zero to advanced e - ประเด็นร้อน

🧠 FINAL SUMMARY

You now understand:

  • Git fundamentals
  • Local vs remote workflow
  • Full command lifecycle
  • Branching & collaboration
  • Conflict resolution
  • Undoing mistakes safely

Top comments (0)