Skip to content

Instantly share code, notes, and snippets.

@abdmun8
Last active January 13, 2022 00:27
Show Gist options
  • Save abdmun8/695c87c3472e000c16d80005c4e2a649 to your computer and use it in GitHub Desktop.
Save abdmun8/695c87c3472e000c16d80005c4e2a649 to your computer and use it in GitHub Desktop.
Git commit how to

Background

By writing good commits, you are simply future-proofing yourself. You could save yourself and/or coworkers hours of digging around while troubleshooting by providing that helpful description.

To come up with thoughtful commits, consider the following:

  • Why have I made these changes?
  • What effect have my changes made?
  • Why was the change needed?
  • What are the changes in reference to?

It's not necessary, but it helps you figure out what you should write.

Conventional commits

The commit type can include the following:

  • feat – a new feature is introduced with the changes
  • fix – a bug fix has occurred
  • chore – changes that do not relate to a fix or feature and don't modify src or test files (for example updating dependencies)
  • refactor – refactored code that neither fixes a bug nor adds a feature
  • docs – updates to documentation such as a the README or other markdown files
  • style – changes that do not affect the meaning of the code, likely related to code formatting such as white-space, missing semi-colons, and so on.
  • test – including new or correcting previous tests
  • perf – performance improvements
  • ci – continuous 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