Das Diff sagt schon, was
Eine Commit-Nachricht, die "Updated user controller" sagt, sind verschwendete Bytes.
Das Sieben-Regeln-Format
- Subject vom Body durch Leerzeile trennen.
- Subject auf 50 Zeichen begrenzen.
- Subject grossschreiben.
- Subject nicht mit Punkt beenden.
- Imperativ verwenden.
- Body bei 72 Zeichen umbrechen.
- Body fur "was" und "warum", nicht "wie".
Ein Beispiel
git commit -m "Reject negative quantities in checkout
Customers were able to submit negative quantities by editing the
DOM, leading to credits being applied to the order total. We add
server-side validation in CheckoutValidator because client-side
checks alone are insufficient against scripted clients."
Conventional Commits
git commit -m "feat(checkout): reject negative quantities"
git commit -m "fix(auth): handle expired refresh tokens"
git commit -m "docs(readme): clarify install steps"
Templates machen es automatisch
cat > ~/.gitmessage 'EOF'
# Subject (50 chars max)
# Why is this change necessary? (wrap at 72 chars)
# How does it address the problem?
# Side effects, follow-ups, links?
EOF
git config --global commit.template ~/.gitmessage
Issues referenzieren
git commit -m "Fix avatar upload race condition
See: PROJ-2207
Co-authored-by: Alex Tan "