Skip to content

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 like Close #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:

  1. 💾 Feat(MainWindow.xaml.cs): Added a new view for user login.
  2. 🔧 Fix: Error on no clients was soluted. Close #14.
  3. 📄 Docs(README): New items added.
  4. 🎇 Style(All): Move '{' after function to new line.
  5. 🧩 Refactor: All Student class was created from Human.
  6. âœ”ī¸ Test: Fibonacci sequence gennerator passed test.
  7. ❌ Test: Fibonacci sequence gennerator didn't passed test.
  8. 📝 Chore: Updated .gitignore, added .exe .
  9. đŸ“Ļ Struct: Moved Human class to Human folder.
  10. 🐛 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:

  1. For collaborators involved, please @ the TA and write the full commit name of the TA so that GitHub can correctly provide a link.