Algocraft / Git Commands

Git Commands

Stop memorizing Git.
Watch it happen.

Every command here drives a live commit graph — branches fork in their own color, merges gain real parent edges, rebase visibly rewrites hashes. Step through a guided scenario, or drop into Sandbox mode and run your own.

10Commands
4Phases
LiveCommit Graphs
Phase 1 Getting Started
init & clone
Starting a Repository

See the "unborn branch" that exists right after init, and everything clone sets up automatically — full history plus remote tracking.

.git folderUnborn BranchRemote Tracking
add, commit & status
The Three Trees

Watch a file travel through Working Directory → Staging Area → Repository, with git status narrating every stop along the way.

Staging AreaWorking DirectorySnapshot
Phase 2 Branching Model
branch & checkout
Movable Pointers

A branch is just a name on a commit. Create one, move HEAD onto it, or detach HEAD onto a raw commit — see exactly what moves and what doesn't.

HEADDetached HEADswitch
merge
Combining Histories

Toggle between a clean fast-forward and a diverged three-way merge, and watch the two-parent merge commit form node by node.

Fast-ForwardThree-Way Merge--no-ff
Phase 3 Rewriting History
rebase
Linear History

Replay a branch's commits onto a new base one by one — every replayed commit gets a brand-new hash. Compare it directly against the same history merged.

History RewriteNew Hashes
cherry-pick
One Commit at a Time

Click any commit in the graph and copy just that one change onto your current branch — without touching its siblings.

Single CommitClick to Select
reset vs revert
Undoing Commits

Undo the same mistake two ways side by side: reset --hard rewrites the pointer and dims the abandoned commit; revert adds a safe inverse commit.

soft/mixed/hardHistory-Safe
Phase 4 Collaboration
stash
Shelving Work

Shelve messy uncommitted changes onto a stack, switch branches with a clean working directory, then pop them right back.

Stash Stackpop vs apply
fetch, pull & push
Talking to Origin

Watch a teammate push behind your back, get a rejected non-fast-forward push, then pull (fetch + merge) to reconcile before pushing again.

Remote TrackingNon-Fast-Forward
tag
Marking Releases

Pin a permanent name onto a commit — lightweight or annotated — and see checking out a tag drop you into detached HEAD, just like any commit.

LightweightAnnotated