All 37 Git lessons
Every lesson pairs a real Git command with a live simulation of what it changes inside .git/ — objects, refs, and the index, step by step. Free forever, nothing to install.
The curriculum
1. What Is Version Control System (VCS) A plain-English answer to what a version control system is, why every team needs one, and how Git stores the entire history inside .git/ — with an interactive simulator. 2. How Git is Different Discover why Git's snapshot-based architecture, local-first operations, and content-addressable database set it apart from traditional VCS like SVN. 3. How to Install Git on Windows, Mac and Linux The complete guide to installing Git on Windows, macOS, and Linux. Step-by-step instructions and command verifications for every operating system. 4. git config Guide: System, Global & Local Settings Understand how git config works under the hood. Learn how local, global, and system configurations override settings and where Git stores them. 5. git init Explained: What Happens Inside .git/ Learn what git init actually does — from creating the .git directory structure to initializing HEAD, refs, objects, and hooks in a new repository. 6. git status Explained: How Git Tracks Changes Discover how git status works behind the scenes. Learn how Git compares workspace files, index manifest, and HEAD pointers to detect changes. 7. git add Explained: How Staging and Blobs Work Understand what git add really does under the hood — how it creates blob objects in .git/objects and updates the binary index manifest. 8. git commit Explained: Snapshots & Tree Objects See exactly what happens when you run git commit — how Git creates tree objects, commit objects, and updates ref pointers to store history. 9. git log Guide: Traversing Commit History & DAG Learn how to inspect your repository's history with git log. See how Git traverses the commit DAG (Directed Acyclic Graph) to render commit logs. 10. git branch Explained: How Git Pointers Work Learn how git branch works under the hood. Understand refs, HEAD, and how Git creates branches as simple 41-byte text files in .git/refs/heads/. 11. git checkout Explained: Switching Branches & HEAD Master git checkout under the hood. Learn how Git alters HEAD, index, and workspace files, and how to safely resolve the detached HEAD state. 12. git merge Explained: Fast-Forward vs Three-Way, Inside .git/ git merge combines two branch histories — a fast-forward when possible, a true three-way merge commit when they've diverged. Watch it happen inside .git/ and handle conflicts with confidence. 13. git rebase Explained: What Happens Inside .git/ (vs Merge) git rebase replays your commits on top of another branch for a clean linear history. See exactly what it rewrites inside .git/, when to rebase vs merge, and the golden rule that keeps you safe. 14. git stash Guide: Saving Work Without Committing Master git stash under the hood. Learn how Git creates commit objects to temporarily store your work, track untracked files, and manage the stash stack. 15. git remote Guide: Managing Remote Repositories Master git remote to connect local repositories to GitHub or GitLab. Learn how remote tracking branches, refspecs, and .git/config entries work. 16. git fetch Explained: Remote Tracking & Objects Learn how git fetch downloads commits, objects, and refs from remote repositories into .git/refs/remotes/ without altering your local workspace. 17. git pull Explained: Fetching & Merging Changes Learn how git pull executes behind the scenes. Understand its fetch and merge/rebase steps, conflict resolution, and internal .git file updates. 18. git push Explained: Uploading Commits & Refs Learn how git push uploads local commits to GitHub/GitLab. Understand fast-forward checks, force-with-lease safety, and internal ref updates. 19. git clone Explained: What Really Happens When You Clone a Repo git clone isn't copy-paste — it runs five Git commands in sequence and downloads the entire history. See exactly what lands inside .git/ when you clone. 20. Git Objects Explained: What's Inside .git/objects Every file, folder, and commit in Git is an object stored inside .git/objects. See blobs, trees, commits, and tags for real — with commands you can run yourself. 21. Git Refs Explained: Heads, Tags & Remotes Learn how Git uses references (refs) like branches, tags, and HEAD. Explore .git/refs/ to see how lightweight text files point to SHA-1 hashes. 22. Git Packfiles Explained: Storage Optimization Discover how Git compresses history. Learn how loose objects are gathered into packfiles using delta compression to optimize disk space and network bandwidth. 23. Git Hooks Explained: Automating Git Workflows Learn how to automate workflows and enforce code standards with Git Hooks. Explore .git/hooks/ and write custom pre-commit and pre-push scripts.
How-tos & common questions
How to Undo the Last Commit in Git Step-by-step guide on how to undo your last Git commit safely. Learn soft, mixed, and hard resets, fixing commit messages, and recovering lost work. How to Rename a Git Branch (Local & Remote) Step-by-step guide to renaming a local and remote Git branch without losing tracking references or history. How to Discard Local Uncommitted Changes in Git Learn how to discard untracked files, modified files, or staged changes in Git using git restore, git checkout, and git clean. How to Resolve Git Merge Conflicts (Step-by-Step) A complete beginner-friendly guide to understanding, fixing, and resolving merge conflicts in Git safely. What is a Detached HEAD in Git and How to Fix It Understand what detached HEAD state means in Git, why it happens, and how to save your commits or safely return to a branch. Git Fetch vs Git Pull: What is the Difference? git fetch downloads remote changes without touching your code; git pull downloads AND merges them. See the exact difference, what each changes inside .git/, and which one is safe. Git Reset vs Revert vs Checkout: Difference Explained A clear comparison of git reset, git revert, and git checkout — when to use each command and how they affect your commits and working tree. How to Squash Commits in Git (Interactive Rebase Guide) Learn how to combine multiple Git commits into a single clean commit using git rebase -i and git merge --squash. How to Change Git Commit Author Name and Email Step-by-step guide to updating the author name and email for the last commit or multiple past commits in Git. How to Delete a Git Branch (Local and Remote) Learn how to delete local branches and remote tracking branches in Git safely using git branch -d and git push origin --delete. What Is the .git Folder? What's Inside and Why It Matters The .git folder is the entire repository — history, objects, refs, and config live there. See what every file inside .git/ does, whether you can delete it, and how it works. How to Cherry-Pick a Commit in Git (Step-by-Step) Learn how to use git cherry-pick to apply specific commits from one branch onto another without merging the entire branch. How to Remove a File from Git Without Deleting It Locally Learn how to use git rm --cached to stop tracking files in Git while keeping them safe on your local disk. How to Fix 'fatal: refusing to merge unrelated histories' Learn why Git throws the 'refusing to merge unrelated histories' error when pulling or merging and how to fix it using --allow-unrelated-histories.
Prefer to explore?
Jump straight into the interactive playground and experiment with Git safely in your browser.