brewly — Ch.1 · Write a real commit message
Exercise 9 of 11
Before you start
A good message
The first line is a summary, like a headline: "Add a search box". Aim for 8 to 50 characters, and say something specific ("fix" or "update" says nothing).
Then leave an empty line and write the body: a sentence or more on why the change was needed. The code already shows what changed.
Writing it in the editor
Without -m, git opens an editor and waits. Write your message at the top. Lines starting with # are help text and are ignored.
Press "Save and close" (or Ctrl+Enter) to commit. "Close without saving" cancels the commit.
- git commit
- open the editor and commit the staged changes
- git diff --staged
- remind yourself what you are describing
You can reopen this any time with “Lesson”.
export function renderCart(cart) {const total = cart.reduce((sum, item) => sum + item.price, 0)document.querySelector('#total').textContent = (Math.round(total * 100) / 100).toFixed(2)}
Graph
- 1354d06 Add menu pageHEAD → mainorigin/main
- 619eb3b Style the order button
- 5fc44ac Initial commit