Skip to content

Instantly share code, notes, and snippets.

@hamdymohamedak
Last active October 3, 2025 22:07
Show Gist options
  • Select an option

  • Save hamdymohamedak/8f00fc0dbff797e89639140f1e78fcde to your computer and use it in GitHub Desktop.

Select an option

Save hamdymohamedak/8f00fc0dbff797e89639140f1e78fcde to your computer and use it in GitHub Desktop.
Conventional Commits - Simple Guide

Conventional Commits - Simple Guide

A simple guide to writing clear and structured Git commit messages using Conventional Commits.


1️⃣ Basic Format

<type>(<scope>): <subject>
  • type: feat, fix, refactor, docs, style, test, chore, perf, ci, build, revert
  • scope (optional): part of the project affected
  • subject: short description (imperative mood, lowercase, no period)

2️⃣ Examples

feat(auth): add Google login
fix(navbar): correct overflow on small screens
refactor(user): simplify profile update
docs(readme): add API usage example
style(button): adjust padding and font size
test(cart): add unit tests for cart functions
chore(deps): update project dependencies
perf(images): optimize image loading speed
ci(github-actions): update workflow
revert: revert "feat(auth): add Google login"

3️⃣ Optional Details

You can add more details using a body and footer.

type(scope): subject

body:

  • More details about the change
  • Why the change was needed
  • Additional notes

footer: BREAKING CHANGE: description of breaking change

Example:

feat(cart): add quantity update

  • Users can now increase/decrease item quantity in the cart
  • Updated total calculation

BREAKING CHANGE: cart API now requires 'quantity' in POST requests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment