Skip to content

Instantly share code, notes, and snippets.

@vinicius73
Last active October 4, 2025 13:11
Show Gist options
  • Select an option

  • Save vinicius73/4ed2d8d463e52f3a2d04b1841aaf2ac5 to your computer and use it in GitHub Desktop.

Select an option

Save vinicius73/4ed2d8d463e52f3a2d04b1841aaf2ac5 to your computer and use it in GitHub Desktop.
Generate Git Commit Message (Gitmoji Convention)

Generate Git Commit Message (Gitmoji Convention)

Goal

Generate a well-structured Git commit message for the last staged project changes, strictly following the Gitmoji convention and best practices.

Context Analysis

  • Staged Changes: Analyze the git diff --staged content to understand what changed.
  • Commit Scope: Infer the context or scope (e.g., JIRA ticket, feature name) from the current branch name.

Steps

  1. Select Gitmoji: Choose the most appropriate Gitmoji and its type (e.g., ✨ feat, πŸ› fix) that accurately reflects the primary change.
  2. Compose the Title (First Line):
  • Create a concise, imperative, and descriptive title.
  • Format: <emoji> <type>: (context or ticket) <short, imperative description>
  1. Compose the Body (Detailed Description):
  • Provide a blank line after the title.
  • Generate a detailed, bulleted list describing all major changes included in this commit.
  1. Review
  • Show the commit message
  • Ask to run commit command
  • If I confirm, do the commit message

Gitmoji examples

  • ✨ feat: add a new feature
  • πŸ› fix: fix a bug
  • πŸš‘ hotfix: urgent critical fix
  • ♻️ refactor: restructure code without changing behavior
  • πŸš€ perf: improve performance
  • 🎨 style: code style changes (formatting, spacing, naming)
  • ✏️ typofix: fix typos
  • 🧹 chore: maintenance tasks (build, configs, housekeeping)
  • βœ… test: add or update tests
  • πŸ“Έ snapshot: update test snapshots
  • πŸ§ͺ mock: add or update mocks
  • πŸ“ docs: update documentation
  • πŸ”Š logs: update log messages
  • βž• add: add a dependency
  • βž– remove: remove a dependency
  • πŸ”₯ remove: remove code or files
  • ⬆️ upgrade: upgrade dependencies
  • ⬇️ downgrade: downgrade dependencies
  • βŒ› deps: lock or pin dependencies
  • πŸ“¦ package: package or publish
  • πŸ”– release: new version or tag
  • βͺ revert: revert changes
  • πŸ”’ security: fix security issues
  • πŸ›‚ auth: update authentication/authorization
  • πŸ”§ config: update configuration
  • πŸ’š ci: update CI pipelines
  • πŸ‘· build: update build system
  • πŸ› οΈ tool: update dev tools
  • πŸ—ƒοΈ db: database changes
  • πŸ—‚οΈ assets: add or update assets (images, icons, fonts)
  • πŸ—οΈ infrastructure: infrastructure changes
  • 🐳 docker: Docker-related changes
  • πŸ†• init: initialize project
  • 🚧 wip: work in progress
  • πŸ—‘οΈ deprecate: mark code or files as deprecated
  • πŸ”€ merge: merge branches
  • πŸ“± mobile: mobile/responsive changes
  • πŸ’„ ui: UI/UX improvements
  • 🌐 i18n: internationalization/localization
  • πŸ§‘β€πŸ’» dev: developer experience improvements
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment