Skip to content

Instantly share code, notes, and snippets.

@yaroofie
Created January 27, 2023 14:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yaroofie/ac78fe236b9166f948391434e9151ef7 to your computer and use it in GitHub Desktop.
Save yaroofie/ac78fe236b9166f948391434e9151ef7 to your computer and use it in GitHub Desktop.
# Git commit message
A commit message shows whether a developer is a good collaborator
The **seven rules** of a great git commit message :
1. Separate subject from body with a blank line
2. Limit the subject line to 50 characters
3. Capitalize the subject
4. Do not end the subject line with a period
5. Use the imperative mood in the subject line
- ie. Clean this, Close that
6. Wrap the body at 72 characters
7. Use the body to explain what and why vs how
A properly formed git commit subject line should always be able to complete the following sentence :
> If applied, this commit will ***your subject line***
## commit message formula
[Type] [optional scope] : [short summary]
[body]
[optional footer]
### message types
- feat - a new feature
- fix - a bug fix
- chore - changes not related to a fix or feature and don't modify src or test files ie. updating dependencies
- refactor - neither fixes a bug nor adds a feature
- docs - updates to documentations such as a README file
- style - changes that do not affect the meaning of the code,likely related to code formatting such as white-space
- test - including new or correcting previous test
- perf - performance improvements
- ci - continous integration related
- build - changes that affect the build system or external dependencies
- revert - reverts a previous commit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment