X

Headline

This is an important message requiring you to make a choice if you're based in the EU.

How to Change Commit Message

Many programmers underestimate the role of the commit message, while it is very important for managing the work. It helps other developers working on your project understand the changes that you have made. So it must be as concrete, well-structured and clear as possible.

In this snippet, we are going to show you the steps to follow if you want to change your commit message in Git.

1. Run Git Rebase in Interactive Mode

Firstly, you should run the git rebase in interactive mode and provide the parent commit as the argument, like this:

git rebase -i HEAD~1

2. Type "Reword"

After the first step, the editor window will show up offering you to input the command for each commit. All you need to do is typing "reword" at the beginning of the first line and save the file:


3. Enter a new commit message

After the second step, you will need to work with the last editor window. Type a new commit message and save the file.


Do you find this helpful?

Related articles