blog icon indicating copy to clipboard operation
blog copied to clipboard

Commit Message Format

Open qingquan-li opened this issue 4 years ago • 0 comments

References: https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#-git-commit-guidelines https://www.ruanyifeng.com/blog/2016/01/commit_message_change_log.html https://cbea.ms/git-commit/

  • Each commit message consists of a header, a body and a footer.
  • The header has a special format that includes a type, a scope and a subject. The header is mandatory and the scope of the header is optional.
  • Any line of the commit message cannot be longer than 100 characters.
  • Do not end the subject line with a period.
  • Use the imperative mood in the subject line.
<type>(<scope>): <subject>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>

Example:

https://github.com/angular/angular.js/commit/2f73f6a8c099e559d8d233d0bbf9dfa48f8d1f38

$ git commit -m 'chore(copyright): update to Google LLC
> 
> - fix minor typo in comment
> 
> Relates to angular/angular#27880
> 
> Closes #17062'

emoji + Subject

Reference: https://gitmoji.dev/

:sparkles: Introduce new features.

🐛 :bug: Fix a bug.

🎨 :art: Improve structure/ format of the code. (Angular-Guidelines: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc))

♻️ :recycle: Refactor code. (Angular-Guidelines: A code change that neither fixes a bug nor adds a feature.)


🎉 :tada: Begin a project.

🔥 :fire: Remove code or files.

🚚 :truck: Move or rename resources (e.g.: files, paths, routes).

🚧 :construction: Work in progress.


📝 :memo: Add or update documentation.

🔧 :wrench: Add or update configuration files.

:white_check_mark: Add or update tests.

💄 :lipstick: Add or update the UI and style files.

qingquan-li avatar Feb 10 '21 19:02 qingquan-li