Skip to content

Instantly share code, notes, and snippets.

@DRFR0ST
Created June 7, 2022 09:05
Show Gist options
  • Save DRFR0ST/11c4dd39b652bfb053b3520daca8263c to your computer and use it in GitHub Desktop.
Save DRFR0ST/11c4dd39b652bfb053b3520daca8263c to your computer and use it in GitHub Desktop.
Commit convention

Commit convention

How to create commits

In our project, we create commits in an orderly way, using emoji for this and start the commit content with a capital letter. The commit body complements β€žthis commit will...". For example: ":lipstick: Fix main container height"

List of emojis that we use

Text Image GFM shortcode* Windows 10 picker name When to use it
πŸŽ‰ πŸŽ‰ :tada: party popper initial commit
✨ ✨ :sparkles: sparkles when adding a new user-facing feature
🎨 🎨 :art: artist palette when improving UI
πŸ“¦ πŸ“¦ :package: package when installing dependencies
♻️ ♻️ :recycle: recycle when refactoring or improving code
🐎 🐎 :racehorse: horse when improving performance
πŸ”’ πŸ”’ :lock: locked when improving security
πŸ”§ πŸ”§ :wrench: wrench when updating configs
β™Ώ β™Ώ :wheelchair: wheelchair symbol when improving accessibility
πŸš€ πŸš€ :rocket: rocket when improving dev tools
πŸ“ πŸ“ :pencil: pencil when writing docs (e.g. README, code comments)
πŸ’Ž πŸ’Ž :gem: gem stone when cutting a new release / version bump
πŸ› πŸ› :bug: bug when fixing a bug
πŸ’₯ πŸ’₯ :boom: collision when fixing a crash
🚱 🚱 :non-potable_water: non-potable water when fixing a memory leak
πŸ”₯ πŸ”₯ :fire: fire when removing code or files
βœ… βœ… :white_check_mark: check mark button when adding new tests
πŸ’š πŸ’š :green_heart: green heart when fixing the CI build
πŸ‘• πŸ‘• :shirt: t-shirt when fixing linter warnings
πŸ“‘ πŸ“‘ :satellite: satellite antenna when adding instrumentation or metrics
πŸ”Š πŸ”Š :loud_sound: speaker high volume when adding logging
πŸ”‡ πŸ”‡ :mute: muted speaker when removing logging
⬆ ⬆️ :arrow_up: up arrow when upgrading dependencies
⬇ ⬇️ :arrow_down: down arrow when downgrading dependencies
🎌 🎌 :crossed_flags: crossed flags when adding an A/B test or feature flag**
⚑ ⚑ :zap: high voltage when making a backwards-incompatible change**
🚧 🚧 :construction: construction when the change is a work in progress (do not merge)**

How to decide which emoji to use

In most cases, your change will fit into a pretty obvious emoji category. If it doesn't, you should think hard about whether or not you're making a clean change.

Often you can break up changes into two or more commits that each accomplish their own specific type of action. If that means you only change one tiny line or fix a simple typo in a commit, so be it! It should be a no-brainer that any given commit does exactly what it says it does β€” and only what is says it does. No side-effects.

In general, you should use exactly one emoji per commit message. In rare cases, you should use a second emoji (e.g. when using something like ⚑ to signify that whatever you just did β€” πŸ›, πŸ”₯, etc. β€” was a breaking change).

Emoji will also depend on your client/user. A back-end API might use ✨ when adding new API endpoints, and the front-end app might use ✨ when using those endpoints to display new content.

The formula

Human WIP

:[EMOJI_NAME]: [THE COMMIT WILL...]

  • :sparkles: Add cool animations
  • :bug: Fix the flicker

RegEx

[:]([A-Z a-z])\w+[:] [A-Z]\w.*$ RegEx example

Examples

  • πŸ› Fix the flicker caused by the drawer
  • ✨ Add a super cool animation for the drawer
  • ♻️ Refactor drawer code
  • πŸ”₯ Remove deprecated drawer code
  • πŸ“¦ Install react-littera@2.1.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment