git branch --show-current
If the branch is main or master, create a feature branch unless the user explicitly requested a direct commit. Re-check the branch and stop if it is still main or master.
Commit one coherent, independently reviewable change at a time.
Use:
<type>(<scope>): <subject>
<optional body>
<optional footer>
Allowed types: feat, fix, ref, perf, docs, test, build, ci, chore, style, meta, license, and revert.
Use ref for refactoring without behavior changes, style for formatting without logic changes, and meta for repository metadata.
Use separate -m arguments for paragraphs and footers. Never put literal \n sequences in a commit message or open an interactive editor.
git commit -m "fix(api): Handle null response in user endpoint" \
-m "Return 404 when the user API finds a deleted account." \
-m "Fixes SENTRY-5678"