A good commit message starts with an action verb and describes what changed in plain language. Write 'Add pricing page' instead of 'Update stuff.' The format is simple: a short summary line (under 72 characters) that tells anyone reading the history exactly what happened. AI tools like Lovable and Cursor auto-generate commit messages, but you should review and edit them for clarity.
Why Commit Messages Matter More Than You Think
Every commit in your project has a message — a short description of what changed. When you look at your project's history, commit messages are the only thing you see without clicking into each commit. Imagine scrolling through a list of 50 commits and seeing: 'Update,' 'Fix,' 'Changes,' 'Update 2,' 'More changes.' That is useless. Now imagine seeing: 'Add pricing page with annual toggle,' 'Fix broken login redirect,' 'Remove deprecated API call.' That tells a story. Good commit messages save hours of debugging because you can quickly scan the history and find when a specific change happened. The formula is simple: start with an action verb (Add, Fix, Update, Remove, Refactor) and describe what changed. Keep it under 72 characters. Write in the present tense, as if you are giving an instruction: 'Add pricing page' not 'Added pricing page.' When AI tools like Lovable, V0, or Cursor generate commits, they often write decent messages — but not always. Review them and edit when needed.
Prerequisites
- A free GitHub account at github.com
- Basic understanding of what a commit is (a save point with a description)
Step-by-step guide
Learn the commit message formula
Learn the commit message formula
A good commit message follows this pattern: Action Verb + What Changed. Use present tense, imperative mood — as if you are giving a command. Examples: 'Add user authentication with Google OAuth,' 'Fix broken link on homepage footer,' 'Update pricing from $29 to $25 per month,' 'Remove unused navigation component.' Keep the summary line under 72 characters. If you need more detail, add a blank line and then a longer description paragraph.
Expected result: You understand the formula: Action Verb + What Changed, under 72 characters.
Review AI-generated commit messages
Review AI-generated commit messages
If you use Lovable, Cursor, V0, or Replit, the AI generates commit messages automatically. Go to your repository on GitHub and click the 'Commits' link near the top of the file list. Scan through the messages. AI tools typically write reasonable messages like 'Update pricing page layout' or 'Add responsive navigation menu.' However, sometimes they produce vague messages like 'Apply changes' or 'Update components.' When you see unclear messages, note which prompts produced them — you can improve your prompts to get better auto-generated messages.
Expected result: You have reviewed your recent commit messages and identified any vague or unclear ones.
Edit a commit message when creating a PR on GitHub
Edit a commit message when creating a PR on GitHub
When you edit a file on GitHub and choose 'Create a new branch for this commit and start a pull request,' a dialog box appears with a commit message field. This is your chance to write a clear message. Replace the default 'Update index.html' with something specific: 'Fix typo in homepage hero heading.' The message you write here appears in the project history forever, so take five seconds to make it descriptive.
Expected result: Your commit message clearly describes the change using the Action Verb + What Changed formula.
Edit a commit message in GitHub Desktop
Edit a commit message in GitHub Desktop
If you use GitHub Desktop, you will see a 'Summary' field at the bottom-left of the app when you have uncommitted changes. This is where you type your commit message. GitHub Desktop requires a summary before it lets you click the blue 'Commit' button. Type your message following the formula: 'Add footer with social media links.' You can optionally add a longer description in the 'Description' field below the summary. Then click 'Commit to main' (or your branch name).
Expected result: Your commit in GitHub Desktop has a clear, descriptive summary message.
Use consistent prefixes for team projects
Use consistent prefixes for team projects
For larger projects, consider using consistent prefixes to categorize commits. Common prefixes: 'feat:' for new features, 'fix:' for bug fixes, 'docs:' for documentation, 'style:' for visual changes, 'refactor:' for code reorganization. Example: 'feat: Add Stripe checkout to pricing page' or 'fix: Resolve login redirect loop.' This convention (called Conventional Commits) makes it easy to scan the history by type. If your team or RapidDev has set up automated release notes, these prefixes can generate changelogs automatically.
Expected result: You understand commit message prefixes and can choose whether to adopt them for your project.
Complete working example
1# Good Commit Messages23Add pricing page with monthly and annual toggle4Fix broken login redirect on mobile Safari5Update hero section copy to match brand guide6Remove deprecated Google Analytics script7Refactor navigation into reusable component89# Bad Commit Messages (avoid these)1011Update12Fix bug13Changes14WIP15Misc updates16asdfasdf17final version18final version 21920# With Conventional Commit Prefixes2122feat: Add user dashboard with activity feed23fix: Resolve CORS error on API calls24docs: Update README with setup instructions25style: Adjust button padding on mobile26refactor: Extract auth logic into custom hookCommon mistakes when writing a Good Commit Message on GitHub
Why it's a problem: Writing 'Update' or 'Fix' with no context
How to avoid: Always say WHAT you updated or fixed: 'Update pricing from $29 to $25' or 'Fix broken image on about page.'
Why it's a problem: Using past tense like 'Added pricing page'
How to avoid: Use present tense imperative: 'Add pricing page.' Think of it as completing the sentence 'This commit will...' Add pricing page.
Why it's a problem: Writing commit messages that are too long
How to avoid: Keep the first line under 72 characters. Put additional details in the description body after a blank line.
Why it's a problem: Letting AI tools write vague commit messages without review
How to avoid: Check your commit history periodically. If AI-generated messages are unclear, improve your prompts or edit the messages before committing.
Why it's a problem: Using the same message for every commit
How to avoid: Each commit should have a unique message that describes its specific change. Identical messages make the history useless.
Best practices
- Start with an action verb: Add, Fix, Update, Remove, Refactor, Move, Rename.
- Keep the summary line under 72 characters — GitHub truncates longer messages.
- Write in present tense, imperative mood: 'Add feature' not 'Added feature.'
- Be specific: 'Fix login redirect on Safari' beats 'Fix bug.'
- Reference issue numbers when relevant: 'Fix signup validation (#23).'
- Review AI-generated commit messages and edit them if they are vague.
- Use Conventional Commit prefixes (feat:, fix:, docs:) for team projects.
- When in doubt, ask yourself: 'If I read this message in six months, will I know what changed?'
Still stuck?
Copy one of these prompts to get a personalized, step-by-step explanation.
I have these five commit messages in my GitHub project: 'Update,' 'Fix stuff,' 'Changes to homepage,' 'WIP,' and 'Final.' Rewrite each one to follow the Action Verb + What Changed format. Be specific and keep each under 72 characters.
Frequently asked questions
Do AI tools write commit messages automatically?
Yes. Lovable, Cursor, V0, and Replit all generate commit messages when they save changes. The quality varies — Lovable usually mirrors your prompt, while Cursor creates messages based on the code changes. Review and edit them if they are vague.
Can I change a commit message after it has been created?
On the GitHub website, you cannot edit a commit message after it is created. In GitHub Desktop or Git, you can amend the most recent commit message, but it is generally better to write it correctly the first time.
Does the commit message affect how my app works?
No. Commit messages are metadata for humans. They have no effect on how your code runs. However, they dramatically affect how easy it is to understand and maintain your project.
What if I am working alone — do commit messages still matter?
Absolutely. Future you is a different person. In three months, you will not remember why you changed that pricing text. Good commit messages are a gift to your future self.
Should I write long or short commit messages?
Keep the first line short (under 72 characters). If you need more context, add a blank line and then a longer description paragraph. Most commits only need the short summary.
Can RapidDev help set up commit message conventions for my team?
Yes. RapidDev can configure Conventional Commits standards, automated linting for commit messages, and PR templates that enforce good documentation practices across your team.
Talk to an Expert
Our team has built 600+ apps. Get personalized help with your project.
Book a free consultation