How to format a good Git commit message

When writing a commit message, it is important to tell a story. Why did you make this change? What is it trying to solve? This way, people in the future can see exactly what your intentions were.

There are a few rules you can stick to that will make sure you have the best commit message in your team! They are as follows:

  • The first line should contain 50 characters or less and explain the change very briefly.
  • The next paragraph should contain a bit more explanation about what you are trying to solve. Try to keep the length of the line under 72 characters; this way, it's easy to scan people.
  • If you have more information that you want to tell, you can do so in the next paragraph. This can be as long and detailed ...

Get GitLab Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.