Commit messages are an essential part of software development. They explain why a change was made and provide context for anyone looking at the project’s history. Writing clear commit messages helps your team understand what has been done, making collaboration easier and the development process smoother.
A good commit message typically has two parts:
Here are some examples in the context of a team of students developing internal services for the college:
fix: resolve crash when submitting feedback form
This message explains that a bug causing a crash was fixed.
feat: add email notifications for assignment deadlines
This message shows that a new feature (email notifications) was added.
refactor: simplify logic for calculating GPA
This message indicates that the code was improved without changing its functionality.
docs: update README with setup instructions
This message explains that the documentation was updated.
fix:
, feat:
, docs:
, and refactor:
to categorize changes.fixed stuff
This message is vague and doesn’t explain what was fixed.
fix: resolve crash when submitting feedback form
This message is clear and provides context.
By writing good commit messages, you contribute to a clear and professional development history that benefits the entire team. Practice this skill, and it will become second nature!