Claude
Skills
Sign in
โ† Back

git-commits

Included with Lifetime
$97 forever

Instructions on how to author git commits

General

What this skill does


# Git Commit Best Practices

## Commit Message Structure

1. **First Line Guidelines**
   - Limit to 50 characters or less
   - Use a gitmoji at the start to indicate commit type
   - Provide a clear, concise summary of the change
   - Capitalize the first letter
   - Do not end with a period

2. **Message Body**
   - Leave a blank line after the first line
   - Explain the motivation for the change
   - Describe how the change solves the problem
   - Use bullet points for clarity
   - Wrap lines at 72 characters

## Gitmoji Reference

Always start your commit message with an appropriate gitmoji to quickly communicate the commit's purpose:

| Emoji | Code | Description |
|-------|------|-------------|
| ๐ŸŽจ | `:art:` | Improve structure / format of the code |
| โšก๏ธ | `:zap:` | Improve performance |
| ๐Ÿ”ฅ | `:fire:` | Remove code or files |
| ๐Ÿ› | `:bug:` | Fix a bug |
| ๐Ÿš‘๏ธ | `:ambulance:` | Critical hotfix |
| โœจ | `:sparkles:` | Introduce new features |
| ๐Ÿ“ | `:memo:` | Add or update documentation |
| ๐Ÿš€ | `:rocket:` | Deploy stuff |
| ๐Ÿ’„ | `:lipstick:` | Add or update the UI and style files |
| ๐ŸŽ‰ | `:tada:` | Begin a project |
| โœ… | `:white_check_mark:` | Add, update, or pass tests |
| ๐Ÿ”’๏ธ | `:lock:` | Fix security or privacy issues |
| ๐Ÿ” | `:closed_lock_with_key:` | Add or update secrets |
| ๐Ÿ”– | `:bookmark:` | Release / Version tags |
| ๐Ÿšจ | `:rotating_light:` | Fix compiler / linter warnings |
| ๐Ÿšง | `:construction:` | Work in progress |
| ๐Ÿ’š | `:green_heart:` | Fix CI Build |
| โฌ‡๏ธ | `:arrow_down:` | Downgrade dependencies |
| โฌ†๏ธ | `:arrow_up:` | Upgrade dependencies |
| ๐Ÿ“Œ | `:pushpin:` | Pin dependencies to specific versions |
| ๐Ÿ‘ท | `:construction_worker:` | Add or update CI build system |
| ๐Ÿ“ˆ | `:chart_with_upwards_trend:` | Add or update analytics or track code |
| โ™ป๏ธ | `:recycle:` | Refactor code |
| โž• | `:heavy_plus_sign:` | Add a dependency |
| โž– | `:heavy_minus_sign:` | Remove a dependency |
| ๐Ÿ”ง | `:wrench:` | Add or update configuration files |
| ๐Ÿ”จ | `:hammer:` | Add or update development scripts |
| ๐ŸŒ | `:globe_with_meridians:` | Internationalization and localization |
| โœ๏ธ | `:pencil2:` | Fix typos |
| ๐Ÿ’ฉ | `:poop:` | Write bad code that needs to be improved |
| โช๏ธ | `:rewind:` | Revert changes |
| ๐Ÿ”€ | `:twisted_rightwards_arrows:` | Merge branches |
| ๐Ÿ“ฆ๏ธ | `:package:` | Add or update compiled files or packages |
| ๐Ÿ‘ฝ๏ธ | `:alien:` | Update code due to external API changes |
| ๐Ÿšš | `:truck:` | Move or rename resources (e.g.: files, paths, routes) |
| ๐Ÿ“„ | `:page_facing_up:` | Add or update license |
| ๐Ÿ’ฅ | `:boom:` | Introduce breaking changes |
| ๐Ÿฑ | `:bento:` | Add or update assets |
| โ™ฟ๏ธ | `:wheelchair:` | Improve accessibility |
| ๐Ÿ’ก | `:bulb:` | Add or update comments in source code |
| ๐Ÿป | `:beers:` | Write code drunkenly |
| ๐Ÿ’ฌ | `:speech_balloon:` | Add or update text and literals |
| ๐Ÿ—ƒ๏ธ | `:card_file_box:` | Perform database related changes |
| ๐Ÿ”Š | `:loud_sound:` | Add or update logs |
| ๐Ÿ”‡ | `:mute:` | Remove logs |
| ๐Ÿ‘ฅ | `:busts_in_silhouette:` | Add or update contributor(s) |
| ๐Ÿšธ | `:children_crossing:` | Improve user experience / usability |
| ๐Ÿ—๏ธ | `:building_construction:` | Make architectural changes |
| ๐Ÿ“ฑ | `:iphone:` | Work on responsive design |
| ๐Ÿคก | `:clown_face:` | Mock things |
| ๐Ÿฅš | `:egg:` | Add or update an easter egg |
| ๐Ÿ™ˆ | `:see_no_evil:` | Add or update a .gitignore file |
| ๐Ÿ“ธ | `:camera_flash:` | Add or update snapshots |
| โš—๏ธ | `:alembic:` | Perform experiments |
| ๐Ÿ”๏ธ | `:mag:` | Improve SEO |
| ๐Ÿท๏ธ | `:label:` | Add or update types |
| ๐ŸŒฑ | `:seedling:` | Add or update seed files |
| ๐Ÿšฉ | `:triangular_flag_on_post:` | Add, update, or remove feature flags |
| ๐Ÿฅ… | `:goal_net:` | Catch errors |
| ๐Ÿ’ซ | `:dizzy:` | Add or update animations and transitions |
| ๐Ÿ—‘๏ธ | `:wastebasket:` | Deprecate code that needs to be cleaned up |
| ๐Ÿ›‚ | `:passport_control:` | Work on code related to authorization, roles and permissions |
| ๐Ÿฉน | `:adhesive_bandage:` | Simple fix for a non-critical issue |
| ๐Ÿง | `:monocle_face:` | Data exploration/inspection |
| โšฐ๏ธ | `:coffin:` | Remove dead code |
| ๐Ÿงช | `:test_tube:` | Add a failing test |
| ๐Ÿ‘” | `:necktie:` | Add or update business logic |
| ๐Ÿฉบ | `:stethoscope:` | Add or update healthcheck |
| ๐Ÿงฑ | `:bricks:` | Infrastructure related changes |
| ๐Ÿง‘โ€๐Ÿ’ป | `:technologist:` | Improve developer experience |
| ๐Ÿ’ธ | `:money_with_wings:` | Add sponsorships or money related infrastructure |
| ๐Ÿงต | `:thread:` | Add or update code related to multithreading or concurrency |
| ๐Ÿฆบ | `:safety_vest:` | Add or update code related to validation |
| โœˆ๏ธ | `:airplane:` | Improve offline support |
| ๐Ÿฆ– | `:t-rex:` | Code that adds backwards compatibility |

## Example Commit Message

```
โœจ Add user authentication middleware

- Implement JWT-based authentication
- Create middleware to validate user tokens
- Add error handling for unauthorized requests

Resolves #123
```

## Additional Best Practices

- Avoid generic messages like "Fix bug" or "Update code"
- Be specific about the changes and their impact
- Reference issue numbers when applicable
- Do not explain HOW the code works in the commit message
- Focus on explaining WHY the change was made
- Never add automatic Co-Authored-By or attribution lines

Related in General