Stage 5 of 8 · 8 lessons · ~3 weeks
Git fundamentals
Learn how Git actually stores your work, then use it daily: small commits, clear messages, branches, merging and rebasing, resolving conflicts and undoing mistakes without losing anything.
Start: How Git thinks: snapshots and historyLessons· one lesson for each topic, in this order
Do this
- Create a repository with a .gitignore before the first commit.
- Make 10 small commits using `git add -p` for at least two of them.
- Rewrite three of your old commit messages into clear summaries (on a practice repo).
- Create a branch, make changes on both it and main, and merge them.
- Create a conflict on purpose and resolve it, then run your tests.
- Rebase a feature branch onto main and compare the log with a merge.
- Undo a commit with `git revert`, and recover a "lost" commit with `git reflog`.
- Finish the main levels of Learn Git Branching.
Start with· follow one of these
- BookFreePro Git
Scott Chacon and Ben Straub
The free official Git book; chapters 2 and 3 cover everything in this stage properly
- CourseFreeThe Missing Semester of Your CS Education
MIT · Beginner
The version control lecture teaches Git from its data model upwards, which makes commands make sense
Practise
Keep handy
Also worth your time
- roadmap.sh: Git and GitHubGo deeper
A map of Git and GitHub topics, from basics to hooks, submodules and Actions
Before moving on: A personal repository with at least 20 meaningful commits across several branches, one merge, one rebase, one resolved conflict and one reverted commit, plus a short note describing each situation and the commands you used.

Commit small and often, and read `git status` and `git diff` before every commit. Nearly everything in Git can be undone if it was committed, and almost nothing can be if it was not. When you are scared, stop, run `git status`, and remember that reflog exists.