Git Submit Message Specification
In Git usage, we use git commit
to submit our changes.
This command can use the -m "<message>"
parameter to specify the commit message.
This message will be recorded in the commit history and will also be displayed on GitHub.
Therefore, the format of this message is extremely important, as it allows collaborators to better understand your changes.
It also facilitates troubleshooting and emergency rollbacks in the future.
The following is the message specification used by Crequency:
Format
<EMOJI> <TYPE>(<SCOPE>): <SUBJECT>
Where:
<EMOJI>
: Optional, represents an emoji corresponding to<TYPE>
, making it easier to find and adding fun.<TYPE>
: Represents the type of commit, optional values are as follows:- đž
Feat
: Indicates that this change adds a new feature or removes an existing one. - đ§
Fix
: Indicates that this change fixes a bug, and such commits often carry statements likeClose #7.
to close an issue on GitHub. - đ
Docs
: Indicates that this change modifies documentation. - đ
Style
: Indicates that this change modifies code style without affecting substantive logic. - đ§Š
Refactor
: Indicates that this change refactors code. - âī¸
Test
: Indicates that this change tests a feature, often unit tests, and the result of the test will be included in<SUBJECT>
. If the test fails, please change<EMOJI>
to â. - đ
Chore
: Indicates that this change modifies build files, generally project maintenance programs or IDE-generated files, such as .sln, .gitignore, makefile, etc. - đĻ
Struct
: Indicates that this change adjusts the directory structure, moves files, but does not involve code changes. - đ
Bug
: Indicates that this change introduces a new bug, um...
- đž
<SCOPE>
: Optional, represents the scope of this change, which can be the name of a single file or a folder.<SUBJECT>
: Subject message, used to roughly describe the content of the change, and corresponds to<TYPE>
.
The following are several message examples:
- đž Feat(MainWindow.xaml.cs): Added a new view for user login.
- đ§ Fix: Error on no clients was soluted. Close #14.
- đ Docs(README): New items added.
- đ Style(All): Move '{' after function to new line.
- đ§Š Refactor: All
Student
class was created fromHuman
. - âī¸ Test: Fibonacci sequence gennerator passed test.
- â Test: Fibonacci sequence gennerator didn't passed test.
- đ Chore: Updated .gitignore, added
.exe
. - đĻ Struct: Moved
Human
class toHuman
folder. - đ Bug(Main): Take a look.
Multi-line Message Appendix
In Format
, we briefly described the format requirements for single-line messages.
This section outlines the format requirements for multi-line messages.
In general, only the first line of the message is required to follow the format from the previous section, and no specific format is imposed on the subsequent lines of a multi-line message.
Therefore, we only propose a few suggestions here:
- For collaborators involved, please
@
the TA and write the full commit name of the TA so that GitHub can correctly provide a link.