Skip to main content
RapidDev - Software Development Agency
github-for-non-tech

How to Write a Good Commit Message on GitHub

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.

What you'll learn

  • The simple formula for writing clear commit messages
  • Why commit messages matter for your project history
  • How to edit auto-generated commit messages from AI tools
  • Common commit message mistakes and how to avoid them
Book a free consultation
4.9Clutch rating
600+Happy partners
17+Countries served
190+Team members
Beginner6 min read5 minutesGitHub.com, GitHub Desktop, and all AI tools that sync with GitHubMarch 2026RapidDev Engineering Team
TL;DR

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

1

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.

2

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.

3

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.

4

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.

5

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

commit-message-examples.md
1# Good Commit Messages
2
3Add pricing page with monthly and annual toggle
4Fix broken login redirect on mobile Safari
5Update hero section copy to match brand guide
6Remove deprecated Google Analytics script
7Refactor navigation into reusable component
8
9# Bad Commit Messages (avoid these)
10
11Update
12Fix bug
13Changes
14WIP
15Misc updates
16asdfasdf
17final version
18final version 2
19
20# With Conventional Commit Prefixes
21
22feat: Add user dashboard with activity feed
23fix: Resolve CORS error on API calls
24docs: Update README with setup instructions
25style: Adjust button padding on mobile
26refactor: Extract auth logic into custom hook

Common 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.

ChatGPT Prompt

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.

RapidDev

Talk to an Expert

Our team has built 600+ apps. Get personalized help with your project.

Book a free consultation

Need help with your project?

Our experts have built 600+ apps and can accelerate your development. Book a free consultation — no strings attached.

Book a free consultation

We put the rapid in RapidDev

Need a dedicated strategic tech and growth partner? Discover what RapidDev can do for your business! Book a call with our team to schedule a free, no-obligation consultation. We'll discuss your project and provide a custom quote at no cost.