Module 5 · ~50 min

Essential Git commands

Goal: Learn the small set of commands you will use every day.

Run these inside your project folder. Same commands on Windows, Mac, and Linux.

git init

Start a new local repo.

git init my-app

git clone

Download a repo from GitHub.

git clone https://github.com/<user>/<repo>.git

git status

See modified and untracked files.

git status

git add

Stage changes for commit.

git add .

git commit

Save a snapshot locally.

git commit -m "Clear message"

git push

Upload commits to GitHub.

git push origin main

git pull

Get latest changes from GitHub.

git pull origin main

git log

View commit history.

git log --oneline

The daily loop

git pull
# edit files
git status
git add .
git commit -m "Clear message"
git push

Checklist

  • I ran git status and understand its output
  • I made a commit with a meaningful message
  • I pushed to GitHub and saw the commit online
  • I can explain add → commit → push in my own words