DEV Community

Maciej Wakuła
Maciej Wakuła

Posted on

Git commit messages

Hints for writing git commit messages.

  • commit message has a header, then optional empty line followed by longer description
    • header is a 1-line abstract summary
    • header can start with a prefix, ex. "fix:", "feat:", "BREAKING" - see https://conventionalcommits.org
    • keep it short, avoid plural, "the", "an", dot, etc.
    • examples: "add lib X", "fix #123", "add default cfg"
    • longer description can be added after an empty separator line - use it to provide details for whoever might need to check this commitin the future, link to tickets, features, links, files
  • use git log --oneline to show only the commit headers
  • as long as it is on your local branch - use rebase to keep your commits on the top of other changes
  • after someone might have used it (ex. you merged it to develop), avoid rebase

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay