Your daily Git workflow

Write useful commit messages

Describe the result of a commit so future readers can understand the history quickly.

8 minute lesson

~~~

A commit message should help someone understand the purpose without opening the diff first.

Use a short command-style subject:

Add password reset form

This reads naturally after the phrase: “If applied, this commit will…”

Avoid messages such as changes, stuff, or fix. The diff shows the changed lines. The message should name the result or intent.

For a change that needs more context, let Git open your editor:

git commit

Write a concise subject, leave a blank line, then explain why the change exists and any decision that is not obvious from the code.

Before committing, inspect git diff --staged. A good message describes that exact snapshot, not all the work you did during the day.

Exercise: compare these messages: Update files, Fix login, and Reject expired password reset links. Which one will help you most six months from now, and why?

Lesson completed

Take this course offline

Get every free book, course edition, and software download.

Get the download library →