Git Commit Message - Is It You? Let's Fix It Together

2 min read
-- views
-- likes
-- comments
Git Commit Message - Is It You? Let's Fix It Together

Series: Git

Episodes: (1/1)
  • Git Commit Message - Is It You? Let's Fix It Together

Is it you? Let's fix it together 😉

git commit

Why You Should Read This Article

  • Improve the quality of commit messages
  • Clear commit content -> reviewers will be very happy -> love for team members -> brotherly bonds strengthen 👌

Requirements before you continue:

  • Have a basic understanding of Git workflow; if not, you can learn more here.

General Structure of a Commit Message

Where:

  • type and description are REQUIRED
  • body is OPTIONAL and may or may not be included

<type>

  • feat: A new feature
  • fix: A bug fix
  • chore: Updates to dependencies that do not relate to bug fixes or new features, and do not change the source code
  • refactor: Renaming functions or variables for clarity, splitting functions, removing redundant code, etc. (these changes do not aim to fix bugs or add features)
  • docs: Documentation updates
  • style: Code formatting updates, such as adding/removing whitespace, deleting extra blank lines, etc.
  • perf: Performance improvements
  • test: Adding missing test cases, fixing unit tests, etc.
  • build: Changes affecting the build process or dependencies
  • ci: Changes to CI configuration files or scripts
  • revert: Reverting to a previous commit

<description>

  • A brief description of the commit content
  • Should be no longer than 50 characters for easy readability on GitHub and other git tools
  • Use an imperative mood, in the present tense. For example: “change ...“ instead of “changed ...“
  • Do not capitalize the first letter
  • Do not use a period at the end of the sentence

[body]

  • This is an OPTIONAL section used to provide a more detailed description of the commit if needed
  • Separate this part from <type>: <description> with a blank line
  • Use it to explain the questions of What (to do) or Why (why it's needed), but NOT How (how to do it)

References

https://www.conventionalcommits.org/en/v1.0.0/

Conclusion

I hope this knowledge is useful for you. Happy coding 👋