Boss lesson · Unit 04
A clean history
Commit messages, tags, .gitignore, hooks and cherry-pick
What you practise
- Small commits with messages that say why, conventional commits (
type(scope): message), tags and releases,.gitignore, hooks,cherry-pickfor one fix
Try a question from this lesson
Pick one
Logins broke some time last month, and this is the history you have to search. What is wrong with it?
$ git log --oneline
7c1d2e3 more fixes
52ab9f0 wip
e09f4c1 stuff
a3b7d55 updateCorrect answer
The messages do not say what changed or why
Why
The diffs do hold everything, but now you must open each one to learn what it is. A message is the index to your history. One clear line per commit turns a search into a scan.
The idea
Concept cards are short on purpose. In the app they appear between questions, after you have met the idea.
Concept
Messages with a shape
A commit message is a note to whoever reads the history later, often you. The first line says what the commit does. A body, if needed, says why.
Conventional commits give the first line a fixed shape: a type, an optional scope in brackets, a colon, then a short summary.
fix(auth): reject expired tokens
Tokens were only checked at login, so
a stolen one kept working. Check them
on every request instead.11 more exercises in the app
- 1× match the pairs
- 2× multiple choice
- 5× type the answer
- 1× fill the blanks
- 1× true or false
- 1× order the lines
Bitpath is an iOS app in development. Join the waitlist and you get one email when it is ready to try.