Learn Git Visually, Not Memorization
Master Git with 30 visualizers and playgrounds including branch workflows, file exploration, and merge simulation. Learn through 6 interactive modules, practice challenges, real-world scenarios, and hands-on playgrounds. Track your progress, unlock achievements, and master Git through visual learning—no memorization required.
- 30
- Visualizers & Playgrounds
- 3
- Advanced Playgrounds
- 40
- Learning Sections
- 100+
- Git Commands
A version control system for your code
Git is a distributed version control system that records every change to your project. Think of it as an unlimited, branching undo history that an entire team can share.
Snapshots, not diffs
Every commit is a full snapshot of your project at a moment in time, stamped with a unique ID.
A complete time machine
Move backward and forward through your history, compare versions, and recover anything.
Built for many hands
Hundreds of developers can work on the same codebase without overwriting each other.
Distributed & safe
Every clone is a full backup. Your history lives on every machine, not one fragile server.
The skill that defines modern engineering
Git is not optional for professional developers. It is the connective tissue of every team, every release, and every open-source project on the planet.
Never lose work again
Commit early and often. Every saved state is recoverable, so experimenting feels safe instead of scary.
Collaborate without chaos
Branches let teammates build features in parallel, then merge them together cleanly.
Understand the why
Commit messages and blame turn your history into documentation of every decision.
Ship with confidence
Review changes, run checks, and roll back instantly if something breaks in production.
The industry standard
From solo projects to billion-line monorepos, Git is the tool nearly every developer uses.
Open source ready
Forks and pull requests are how the world contributes to projects together.
Where your code actually lives
A change travels through four places. Tap any stage to see how it moves and which command pushes it forward.
Staging Area
A draft of your next commit. You hand-pick exactly which changes will be recorded together.
Command
$ git add <file>
Move a change from working directory to staging.
Watch a change become a commit
Follow a single file as it travels from your editor all the way to the remote. Press play, or step through it yourself.
Edit
Working Directory
Stage
Staging Area
Commit
Local Repository
Push
Remote Repository
Edit
You change a file. Git sees it as "modified" but is not tracking it for the next commit yet.
Run
$ vim app.tsx
Build your own commit graph
Branches are cheap, movable pointers. Click the buttons to commit, branch off, and merge — and watch the graph grow in real time.
Command history
Live Branch Switcher
Create, switch, and manage branches in real-time. See exactly how Git tracks your work.
Branches
Create New Branch
Current HEAD
main @ def5678
Staging Area Visualizer
Understand how git add moves files through the working directory → staging area → repository
Working Directory
git add
Staging Area (Index)
Nothing staged yet
git commit
Create Commit
Commit History
File Status Visualizer
Understand how Git tracks file changes through different states in the repository lifecycle.
Git Diff Visualizer
See exactly what changed between versions with visual diff highlighting.
Merge vs Rebase, side by side
Same starting point, two different outcomes. Flip between them to see exactly how each command reshapes your history.
Branches have diverged
main moved on to C and D while you built X and Y on feature. Both branches share commit B as their common ancestor.
Advanced Rebase Simulator
Watch commits replay in real-time. See how rebase replays feature commits on top of main's latest.
Main Branch
Feature Branch
Activity Log
Key Points:
- Rebase replays commits one by one
- Each commit gets a new hash
- Clean, linear history
- Never rebase shared commits!
Conflicts aren't scary
A conflict just means two branches changed the same line. Git asks you to decide. Pick a resolution below and watch the markers disappear.
// theme configuration
<<<<<<< HEAD (ours)
const theme = "dark"
=======
const theme = "light"
>>>>>>> feature (theirs)
export default theme
Choose a resolution
Merge Conflict Resolution
Learn how to identify and resolve merge conflicts step by step
Conflict #1
Conflict #2
How to resolve manually:
- 1. Open the conflicted file in your editor
- 2. Look for conflict markers: <<<<<<<, =======, >>>>>>>
- 3. Decide which version to keep (or combine both)
- 4. Delete the conflict markers and unwanted code
- 5. Save the file
- 6. Run: git add . && git commit -m "message"
Live Merge Conflict Resolution
Real-time conflict resolution. Choose how to combine conflicting changes and watch the result.
Choose Resolution
Terminal Output
Git Flow vs GitHub Flow vs Trunk
There is no single right way to branch. Compare the three most common strategies and find the one that fits your team.
Branches
- main
- feature/*
Best for
Web apps that deploy continuously.
Pros
- + Easy to learn
- + Fast feedback via PRs
- + main is always deployable
Trade-offs
- − Less release structure
- − Needs strong CI/CD
- − Not ideal for versioned libs
It's just four kinds of objects
Under the hood Git is a tiny content-addressable database. Everything you do is built from blobs, trees, commits, and refs.
Commit — the snapshot
A commit points to one tree, its parent commit(s), and stores the author, message, and timestamp.
git cat-file -p 7d4e1f0
tree a1b2c3d parent 3c5a9b1 author you <you@dev> Add feature
How the world ships code together
Pull requests turn solo commits into a team conversation. This is the exact loop used by open-source projects and engineering teams everywhere.
- 01
Fork & clone
Copy the project to your account, then clone it locally.
- 02
Branch & push
Create a feature branch, commit your work, and push it up.
- 03
Open a PR
Propose your changes with a clear title and description.
- 04
Code review
Maintainers comment, request changes, and approve.
- 05
Merge & ship
Once approved and green, your work merges into main.
Add dark mode toggle
maintainer
Looks great! Can you add a test for the toggle?
you
Done — added a test and updated the docs.
Code review etiquette
- Keep PRs small and focused — easy to review, easy to merge.
- Write a description that explains the why, not just the what.
- Respond to feedback with commits, not arguments.
Your first contribution
Look for issues labeled good first issue. Fork, fix, and open a PR — maintainers love new contributors.
Remote Sync Playground
Visualize push, pull, and fetch operations between local and remote repositories
Local: main
Remote: origin/main
Event Log
HEAD Pointer Tracker
Understand how HEAD pointer moves and detached HEAD state
Commit History
HEAD: main
HEAD points to main branch
History
HEAD Pointer:
- • Always points to the current commit you're on
- • Usually points to a branch name (attached)
- • Can point directly to a commit (detached)
- • Moving to a branch moves HEAD to that branch's latest commit
Cherry-Pick Simulator
Copy specific commits from one branch to another
feature/button
main
History
When to use cherry-pick:
- • Copying bug fixes from one branch to another
- • Selectively including features
- • Avoiding merging unrelated changes
- ⚠️ Use sparingly on shared branches (rewrites history)
Stash Manager
Temporarily save changes without committing them
Current Changes
Stashed Changes (2)
Key Differences:
- • Pop: Applies stash and removes it
- • Apply: Applies stash but keeps it in the list
- • Stashed changes are not part of any commit
Git Reset Visualizer
Understand the three modes of git reset: soft, mixed, and hard.
Git Clone Visualizer
See what happens when you clone a remote repository to your local machine.
Git Reflog Visualizer
Recover lost commits using the reference logs. Git never truly deletes your work!
Git Tag Visualizer
Mark important commits with tags for releases and milestones.
Git Bisect Visualizer
Use binary search to find the exact commit that introduced a bug.
.gitignore Visualizer
Control which files Git tracks with pattern matching rules.
Advanced Topics
Master advanced Git concepts for professional workflows
Git Hooks
Automate tasks by running scripts at key points in the Git workflow
- •Located in .git/hooks/ directory
- •Can be written in any language (shell, Python, etc.)
- •Use case: Run tests before committing
- •Use case: Format code automatically
- •Share hooks by storing in version-controlled directory
Progress Dashboard
Track your mastery of Git and earn achievements
0 of 31 sections
From challenges completed
Badges unlocked
Keep the streak going!
Learning Streaks
Upcoming Achievements
Complete 3 sections
Complete 15 sections
Complete all 31 sections
Score 200+ points in challenges
Interactive Tutorials
Step-by-step guided learning for common Git workflows
Practice Challenges
Quiz yourself on Git concepts with immediate feedback
What does `git add .` do?
Troubleshooting Guide
Common Git errors, their causes, and solutions
You are trying to use Git commands in a folder that is not initialized as a Git repository
- 1.Initialize Git in the current directory
- 2.Navigate to an existing Git repository folder
- 3.Check if you are in the correct directory using `pwd`
Always ensure you are in the correct project folder before running Git commands
Scenario Missions
Learn Git through realistic developer scenarios
Run Git without the risk
A safe sandbox terminal. Type real commands and watch how the repository responds — no setup, nothing to break.
Welcome to the LearnGit playground. Type 'help' to see commands.
Start with: git init
Try these
Master branching strategies
Create, switch, merge, and delete branches. Learn how teams collaborate using branching workflows.
Branch Manager
Merge Operations
Create branches to merge them back to main
Main Branch Commits:
abc123 Initial commit
Terminal Output
Branch Workflow Playground Ready
Create branches, add commits, merge, and delete branches
Visualize file changes
Create files, edit content, stage changes, and commit. See exactly what happens to your repository.
Files
Select a file
Click a file to edit its content
Git Status
Commit History
Initial commit
fafcb91
Practice merge resolution
Simulate real merge scenarios. Start a merge, resolve conflicts, and complete the merge process.
main branch
Line 1: Welcome
Alice
Line 2: Main feature
Alice
Line 3: Conclusion
Alice
feature branch
Line 1: Welcome
Bob
Line 2: New feature
Bob
Line 3: Conclusion
Bob
merged result
Start merge to see result
Merge Steps
Terminal
Ready to simulate merge
Every command you'll actually use
Search, filter by category, and copy any command. This is your living cheat sheet.
$ git init
Create a new Git repository in the current directory.
Setup$ git clone <url>
Copy a remote repository to your machine.
Setup$ git config user.name "Name"
Set the author name for your commits (local).
Setup$ git config user.email "email@example.com"
Set the author email for your commits (local).
Setup$ git config --global user.name "Name"
Set the author name globally for all repositories.
Setup$ git config --global user.email "email@example.com"
Set the author email globally for all repositories.
Setup$ git config --global alias.st status
Create a custom command alias (e.g., git st as shorthand for git status).
Setup$ git config --list
Show all configuration settings for this repository.
Setup$ git status
Show changed, staged, and untracked files in the working directory.
Basics$ git add <file>
Stage changes in a specific file for the next commit.
Staging$ git add .
Stage every change in the working directory.
Staging$ git add -p
Interactively choose which parts of a file to stage.
StagingFrom first commit to Git mastery
A structured path through 27 interactive visualizers and 100+ Git commands. Work through each level to go from total beginner to confident contributor.
Foundations
- Install & configure Git
- init, clone, status
- Staging & your first commit
- Reading git log
Everyday Flow
- Branches & switching
- Merging branches
- Pushing & pulling
- Working with remotes
Collaboration
- Pull requests
- Code review etiquette
- Resolving conflicts
- Forks & open source
Mastery
- Interactive rebase
- Cherry-pick & reflog
- Git internals & objects
- Branching strategies
Keep leveling up
Hand-picked references and tools to deepen your Git knowledge after the lessons.
Git Official Docs
Complete reference for all Git commands, plumbing, guides, and workflows from git-scm.com.
Explore →Quick ReferenceGit Cheat Sheet
Official Git cheat sheet with the most common commands, perfect for quick reference.
Explore →BookPro Git Book
The complete, free reference written by the Git community. Covers everything from basics to advanced topics.
Explore →GuideEveryday Git
A curated list of useful Git commands for common workflows and scenarios.
Explore →ReferenceGit Glossary
Definitions of all key Git concepts: commits, branches, HEAD, stash, rebasing, and more.
Explore →GuideGit Hooks
Learn how to automate tasks with client-side and server-side Git hooks.
Explore →Guide.gitignore
Master pattern-matching to exclude files from version control automatically.
Explore →ReferenceRevisions
Reference syntax for specifying commits: branch names, tags, parents, ranges, and more.
Explore →GuideSubmodules
Learn to manage Git repositories within Git repositories.
Explore →GuideGit Workflows
Explore common branching strategies: Git Flow, GitHub Flow, and trunk-based development.
Explore →HelpFAQ
Frequently asked questions about Git usage, configuration, and troubleshooting.
Explore →ToolInteractive Sandbox
A safe scratch repository to practice without breaking anything.
Explore →Questions, answered
The things developers ask most when they start learning Git the visual way.
No. Most developers use about 12 commands daily. LearnGit teaches you the mental model behind Git so the commands make sense — you reach for the right one because you understand what is happening, not because you memorized it.