Learn
Git & GitHub, made simple.
Never used Git before? Start here. Understand version control, repositories, commits, branches, merges and pull requests in everyday language — and learn to do each one both in the terminal and in VS Code. Pick how you want to learn.
Read the guide
Short, plain-English chapters. Every command is shown for the terminal and for VS Code, with real examples.
Start reading → InteractivePlay the game
Click to commit, branch and merge and watch the commit tree move. Guided levels with goals, plus a free sandbox.
Open playground →All chapters
Read top to bottom, or jump straight to your error.
Basics
Install Git and learn the daily save cycle.
01What is Git & GitHub?
Version control in plain English — what Git does, what GitHub adds, and why every developer uses them.
02Install & Set Up
Install Git, set your name and email, and get VS Code ready — the one-time steps before your first commit.
03Repositories
What a repository (repo) is, starting one with init, downloading one with clone (incl. VS Code's Git: Clone), and checking its state.
04Add & Commit
The save cycle: edit files, stage them with add, and lock in a snapshot with commit. Plus status and good messages.
05Ignore Files (.gitignore)
Keep secrets, node_modules and build junk out of version control: write a .gitignore, decode the pattern syntax, and untrack files committed by mistake.
Branching & History
Work on ideas in parallel and read the project’s past.
06Viewing History
Read a project’s past: git log (oneline, graph, stat), inspect a commit with show, compare versions with diff, and trace a line with blame.
07Branches
Work on a new feature without touching the main code. Create, switch, and understand HEAD and the branch tip.
08Merge & Rebase
Bring branches back together. Merge vs rebase explained simply, plus how to handle a merge conflict calmly.
09Fix Merge Conflicts
What a conflict really is, how to read the <<<<<<< markers, fix it with VS Code's Merge Editor, and abort safely when you want out.
10Stashing Changes
Shelve work-in-progress so you can switch tasks: git stash, list, pop vs apply, drop, and when a quick WIP commit is the better move.
GitHub & Collaboration
Put your code online and work with other people.
11Connect to GitHub
Prove you're you to GitHub — sign in inside VS Code, then authenticate the terminal with a Personal Access Token, SSH keys, or one gh auth login.
12Push & Pull
Connect your repo to GitHub with a remote, then push your commits up and pull other people’s changes down.
13Pull Requests
The heart of teamwork: branch, push, open the PR (github.com, the VS Code extension, or gh), handle review, merge, and tidy up locally.
14Fork & Sync
Contribute to projects you don't own: clone vs fork, origin vs upstream, GitHub's Sync fork button, and opening a PR back to the original.
15Tags & Releases
Mark versions with tags (lightweight vs annotated), push them, follow semantic versioning, and publish polished GitHub Releases.
Fix-it / Rescue
Something looks wrong? Find your exact error and fix it — both ways.
16Discard & Unstage Changes
The gentlest undos: throw away edits with restore, pull a file back out of staging with restore --staged, and clear untracked leftovers with clean's dry run.
17Undo Commits (amend, reset, revert)
Fix the last commit with --amend, un-commit with reset (soft/mixed/hard decoded), and safely reverse an already-pushed commit with revert.
18Committed on the Wrong Branch
Committed on main by mistake? Move the commit to a new or existing branch with branch, cherry-pick and reset — the commit itself is never lost.
19Detached HEAD, Explained
Why Git says "You are in detached HEAD state", what HEAD actually is, and the two ways out — switch back to main, or keep your commits on a new branch.
20Recover Lost Work (reflog)
Work vanished after a reset --hard or a deleted branch? Read Git's private diary with git reflog, find the lost commit's hash, and bring it back.
21Push Rejected & Diverged Branches
Decode "! [rejected] (fetch first)" and "your branches have diverged": pull then push, the Sync Changes button, pull --rebase, and why --force is a trap.
22Fix GitHub Login Errors
Cure "password authentication was removed" and "Authentication failed": sign in with gh auth login, flush stale saved tokens, and fix wrong-account 403s.
23File Too Large to Push
Fix GitHub's GH001 100 MB error: untrack the file with rm --cached and amend, stop committing node_modules, and when Git LFS is actually worth it.
24CRLF vs LF on Windows
Why Git warns "LF will be replaced by CRLF", why it's harmless, the core.autocrlf one-time fix, VS Code's status-bar switch, and .gitattributes for teams.
25Rename master to main
Four commands to rename your default branch: git branch -m, push -u, switch GitHub's default in Settings, and make every new repo start on main.
Reference
The one-page lookup.
New to the command line? Don’t worry — you can do almost everything from VS Code’s Source Control panel, and every step below shows you exactly where to click.