How to Write Good commit

Source: Author use sourcetree


I found a great article how to improve my commit in medium, check this link 
https://betterprogramming.pub/write-better-git-commit-messages-to-increase-your-productivity-89fa773e8375


 Note: How use good commit

  • feat: introduce a new feature
  • fix: patches a bug in your codebase (bugfix or hotfix)
  • build: changes that affect the build system or external dependencies
  • chore: updates dependencies and does not relate to fix or feat and does not modify src or test files.
  • ci: changes that affect the continuous integration process
  • docs: updates the documentation or introduce documentation
  • style: updates the formatting of code; remove white spaces, add missing spaces, remove unnecessary newlines
  • refactor: reactors code segments to optimize readability without changing behavior
  • perf: improve performance
  • test: add/remove/update tests
  • revert: reverts one or many previous commits


Example

Good

  1. perf: optimize loading of items on landing page
  2. feat: send an email to the customer when a product is shipped
  3. fix: add the correct company name to the footer and replacing the dummy text
  4. revert: revert a previously introduced bug in items retrieving from database

Bad

  1. optimize landing page
  2. send email
  3. oops
  4. I think I fixed it this time?


In this note for example I create after read that article 

Before:
git commit -m <[NTT-188] what handle>

After:
[ticket-number][Progress] <description>
git commit -m <[XTX-188][feat] add correct popover >


No comments: