Commandtypescript
/commit Command
Create an atomic commit with conventional commit format.
Commit Changes
Create an atomic commit with conventional commit format.
Instructions
-
Run
git statusto see changes -
Confirm the branch. Stop and do not commit if the local branch is
mainor is tracking the remotemainbranch -
Run
git diff --statfor summary -
Determine the appropriate commit type:
feature: New featurefix: Bug fixdocs: Documentation onlystyle: Formatting, no code changerefactor: Code change that neither fixes nor addstest: Adding or updating testschore: Maintenance tasks
-
Create commit message:
<type>(<scope>): <description>
Scopes
Common scopes for this project:
component- Discrete component changesicon- Changes ot iconsapp- Changes to moo-appinfra- Changes to infrastructure, DevOps, code layout etc.
Rules
- Keep description under 72 characters
- Use imperative mood ("add" not "added")
- Use proper capitalisation and grammar
- Reference issue numbers if applicable:
fix(api): resolve null reference (#123) - For breaking changes, add
!after scope:feat(api)!: change auth flow
Examples
component(moo-ds/components/CloseBadge.tsx): Add support for custom close icon
icon(moo-icons/assets/BagOfMoney.svg): Add a bag of money icon
fix(moo-ds/component/Breadcrumb.tsx): Fix wrapping issue on small screens
refactor(moo-app): migrate account list to SectionTable component
chore: Update npm dependencies
docs: Add more stories
Commit Message Format
git commit -m "$(cat <<'EOF'
<type>(<scope>): <description>
<optional body with more details>
EOF
)"