-
Notifications
You must be signed in to change notification settings - Fork 4
Commit Messages
Clear, consistent commit messages make it easier for teammates (and your future self) to understand why a change was made.
This page explains how to write strong commit messages and provides examples of both good and bad patterns.
These guides explain the philosophy behind good commit messages:
- The Odin Project β Commit Messages
https://www.theodinproject.com/lessons/foundations-commit-messages - freeCodeCamp β How to Write Better Git Commit Messages
https://www.freecodecamp.org/news/how-to-write-better-git-commit-messages/
If you're short on time, read the guidelines below.
(Summarized from freeCodeCamp and industry best practices)
- Capitalize the first word.
- Do not end the subject line with punctuation.
- If using Conventional Commits, the type (feat, fix, refactor, etc.) remains lowercase.
Example:
Add fix for dark mode toggle state
Write your commits like instructions or actions:
- βAdd user authenticationβ
- βFix navbar layoutβ
- βUpdate API routeβ
Avoid:
- βAddedβ¦β
- βFixesβ¦β
- βUpdatedβ¦β
Be clear about what kind of change you made.
Typical types:
- Bugfix
- Update
- Refactor
- Bump
- Add
- Remove
- Polish
Consistent wording helps maintainers read project history quickly.
- First line ideally β€ 50 characters
- Body text should wrap at 72 characters
Short, clear, direct.
Avoid filler phrases like:
- βkind ofβ
- βmaybeβ
- βI thinkβ
- βsort ofβ
Write what was done and why it matters.
Be specific, like a journalist.
5ba3db6 Bugfix failing CompositePropertySourceTests84564a0 Refactor @PropertySource early parsing logice142fd1 Add tests for ImportSelector meta-data887815f Update docbook dependency and generate epubac8326d Polish mockito usage
These are:
- Clear
- Specific
- Short
- Easy to scan in history
e5f4b49 Re-adding ConfigurationPostProcessorTests after its brief removal in r814. @Ignore-ing the testCglibClassesAreLoadedJustInTimeForEnhancement() method as it turns out this was one of the culprits in the recent build breakage. The classloader hacking causes subtle downstream effects, breaking unrelated tests. The test method is still useful, but should only be run on a manual basis to ensure CGLIB is not prematurely classloaded, and should not be run as part of the automated build.
Problem: too long, too detailed for a single commit.
2db0f12 fixed two build-breaking issues: + reverted ClassMetadataReadingVisitor to revision 794 + eliminated ConfigurationPostProcessorTests until further investigation determines why it causes downstream tests to fail (such as the seemingly unrelated ClassPathXmlApplicationContextTests)
Problem: mixes multiple unrelated actions; uses past tense.
-
147709f Tweaks to package-info.java files -
22b25e0 Consolidated Util and MutableAnnotationUtils classes into existing AsmUtils -
7f96f57 polishing
Problem: too vague β lacks explanation of what changed and why.
- Write commits that represent one change.
- Commit frequently to show progress.
- Write commit messages that would still make sense six months from now.
- Think of the subject line as a small summary, and the body as optional context.
β‘οΈ Proceed to: Resolving Merge Conflicts
Home β’ New Student Onboarding β’ Guides β’ Projects β’ Code of Conduct β’ FAQ
Last updated: 12/7/2025