Repaso
EspaƱol
Maven, Git & SDLCIntermediateVCS-21

What is a good commit message and commit size?

Options

  1. 'fix' as the message, and one huge commit per week
  2. A short imperative summary, in a small focused commit (Correct option)
  3. The full source code of the changed file as text
  4. Only emojis as the message, with no further text

Answer

A short, imperative summary of WHAT and WHY ("Fix null email in signup"), in a small commit that does one logical change

Why

Small, focused commits make history readable, reviews easier, git bisect possible and reverts safe.

Subject line: imperative mood, about 50 characters ("Add retry to payment client"). Optional body explaining why. Reference the ticket (PROJ-123).

Avoid: "fix", "stuff", "WIP", and mixing refactoring with feature changes in one commit.

Remember

One logical change per commit; explain the why.

Key terms

Practice this question in Repaso