A blog series

Git and GitHub From Zero

Git from the first commit to team workflows: the mental model, the daily loop, branches and conflicts, remotes and pull requests, undoing mistakes and rebase. Every command was run in a throwaway repository and the real output is shown.

Started 
2026
Lessons 
6
Reading 
~1 h

Contents

Every lesson has the same steps: what it is, how it works, a real example, common mistakes, then interview questions with answers you can say out loud.

  1. Lesson 00The Mental Model: Snapshots, Commits and BranchesThe working tree, the staging area and the repository, how a commit is a snapshot with a parent, and how branches and HEAD are just pointers.7 min
  2. Lesson 01The Daily Loop: Status, Add, Commit, Diff and LogThe commands you use every day, .gitignore, good commit messages and staging parts of a file with git add -p.9 min
  3. Lesson 02Branches, Merging and ConflictsFast-forward versus merge commits, and a real merge conflict resolved step by step.8 min
  4. Lesson 03Remotes, Pull Requests and Code ReviewRemotes, fetch versus pull, upstream tracking, forks, and the pull request flow with review habits.9 min
  5. Lesson 04Undoing Things Safely: Restore, Reset, Revert, Reflog and FriendsThe undo tools run for real, recovering a lost commit with reflog, bisect, and a table of which command to use.10 min
  6. Lesson 05Rebase, Clean History and Team WorkflowsRebase versus merge, tidying history, force-with-lease, branch protection, CODEOWNERS and a first GitHub Actions workflow.11 min

Glossary

17 terms used in this series. Inside any lesson, hover or tap a dotted term to see its meaning without leaving the page. Browse all terms →