A visual simulation. Type commands and watch files move between zones.
touch filename — create a new file in working directoryedit filename — modify an existing file (marks it as changed)rm filename — delete a file from working directorygit add filename or git add . — stage files (Working → Staging)git commit -m "msg" — commit staged files (Staging → Local Repo)git push — push commits to remote (Local → Remote)git pull — pull from remote (Remote → Working + Local)git status — see what's changed and stagedgit log — view commit historygit diff — show unstaged changesgit stash — temporarily shelve changesgit stash pop — restore shelved changesgit reset filename — unstage a file (Staging → Working)git checkout -- filename — discard working changesgit branch branchname — create a new branchgit checkout branchname — switch to a branchgit merge branchname — merge another branch into currenttouch index.html — create your filestouch styles.csstouch app.jsgit add . — stage everythinggit commit -m "initial commit" — save snapshotgit push — upload to GitHubedit app.js — make changes to an existing filegit status — see what changedgit add . — stage changesgit commit -m "update app logic"git pushedit index.html — bug fixedit styles.css — bug fixedit app.js — unrelated experimentgit add index.html — stage only the fixgit add styles.cssgit commit -m "fix layout bug" — clean commit!git status — app.js still in working diredit app.js — you're mid-featuregit stash — shelve it, working dir is cleangit status — clean! safe to switch tasksgit stash pop — bring your changes backgit status — changes are back, keep workingedit index.htmledit app.jsgit add . — oops, staged everythinggit reset app.js — unstage just app.jsgit status — app.js back in working, index.html still stagedgit commit -m "update index"git branch new-feature — create branchgit checkout new-feature — switch to ittouch feature.js — build the featuregit add .git commit -m "add feature"git checkout main — switch backgit merge new-feature — bring feature into maingit pushgit pull — grab latest from remotegit log — see what's newtouch newfile.js — now start your workgit add .git commit -m "add newfile"git pushThink of it as a conveyor belt flowing left to right: you create files in your working directory, stage the ones you want to snapshot, commit that snapshot to your local history, then push it to the shared cloud. pull goes the other way.
Staging is like a loading dock. You pick which boxes (files) go on the truck (commit) before it leaves. Without it, every commit would be "everything I changed" — staging lets you say "just these specific changes go together."
Your local repo is your personal history. You can commit all day without anyone seeing it. push is when you share. This means you can experiment, make messy commits, even reset — all before anyone else knows.
A branch is a copy of your project's timeline where you can make changes without affecting the original. When you're happy with the result, you merge it back. Think of it like a "save slot" — you branch off, try something, and if it works, bring it home.
Stash temporarily copies your uncommitted changes to a shelf. Your working directory becomes clean (as if you hadn't changed anything). stash pop pastes them back. Useful when you need to quickly switch tasks without committing half-done work.