Git Cheatsheet

92 commands Click any command or row to copy immediately to clipboard.

πŸ—ΊοΈ

Git Architecture & 4 Core Lifecycle Zones

Mental model: how your code moves between disk, staging, HEAD, and GitHub
01
Local Disk

Working Tree

Your actual files on your machine. Contains modified, untracked, or deleted files.

Stage file → git add <file>
02
Index / Cache

Staging Area

The prep area. Files gathered here form the exact blueprint for your next commit.

Commit → git commit -m
03
Local Repo

HEAD Commit

Permanent snapshot saved in your local git history with a unique SHA-1 hash.

Upload → git push origin
04
Cloud / Remote

Remote (GitHub)

Shared cloud repository where teammates collaborate and automated CI/CD runs.

Sync back ← git pull origin
Student Tip Unsure what changed? Always run git status before git add and before git commit. It prevents committing secret keys, debug code, or incomplete files!
βœ“ Copied: git status to clipboard