Learn Git Visually, Not Memorization
Stop copy-pasting commands you don't understand. See commits, branches, merges, rebases, and pull requests come alive through interactive animations and real-world developer workflows.
- 14
- Visual Lessons
- 40+
- Commands
- 6
- Simulators
- 0
- Memorization
- git commit★
- branch★
- merge★
- rebase★
- pull request★
- cherry-pick★
- stash★
- HEAD★
- origin/main★
- fast-forward★
- squash★
- reflog★
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
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.
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
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.
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
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 folder.
Setup$ git clone <url>
Copy a remote repository to your machine.
Setup$ git config --global user.name "Name"
Set the author name for your commits.
Setup$ git status
Show changed, staged, and untracked files.
Basics$ git add <file>
Stage changes for the next commit.
Basics$ git add .
Stage every change in the working directory.
Basics$ git commit -m "msg"
Record staged changes as a new commit.
Basics$ git log --oneline --graph
View commit history as a compact graph.
Inspect$ git diff
Show unstaged changes line by line.
Inspect$ git show <sha>
Inspect the contents of a specific commit.
Inspect$ git blame <file>
See who last changed each line of a file.
Inspect$ git branch <name>
Create a new branch from the current commit.
Branching$ git switch <name>
Move HEAD to another branch.
Branching$ git switch -c <name>
Create and switch to a new branch.
Branching$ git merge <name>
Combine another branch into the current one.
Branching$ git rebase <base>
Replay commits on top of another base.
Branching$ git push origin <branch>
Upload local commits to the remote.
Remote$ git pull
Fetch and merge changes from the remote.
Remote$ git fetch
Download remote changes without merging.
Remote$ git remote -v
List configured remote repositories.
Remote$ git restore <file>
Discard changes in the working directory.
Undo$ git restore --staged <file>
Unstage a file without losing changes.
Undo$ git reset --hard <sha>
Reset branch and working tree to a commit.
Undo$ git revert <sha>
Create a new commit that undoes another.
UndoFrom first commit to Git mastery
A clear path through the platform. Work top to bottom and you'll 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.
Pro Git Book
The complete, free reference written by the Git community.
Explore →DownloadCheat Sheet PDF
A printable one-pager of the commands you use every day.
Explore →ToolInteractive Sandbox
A safe scratch repository to practice without breaking anything.
Explore →TemplatesWorkflow Templates
Ready-made branching strategies for teams of any size.
Explore →VideosVideo Walkthroughs
Short, focused clips that visualize one concept at a time.
Explore →CommunityCommunity Forum
Ask questions and learn from thousands of other developers.
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.