The commit command is used to save changes to a local repository after staging in Git. However, before you can save changes in Git, you have to tell Git which changes you want to save as you might have made tons of edits. A great way to do that is by adding a commit message to identify your changes.
This option sets the commit's message.
This option automatically commits all (including new) tracked, modified or deleted files.
This option rewrites the very last commit with any currently staged changes or a new commit message and should only be performed on commits that have not been pushed to a remote repository, yet.
You might say, "It's just a personal project." Yes, you work alone now, but what happens when you work with a team or contribute to open source?
A well-crafted Git commit message is the best way to communicate context about a change to other developers working on that project, and indeed, to your future self.
Have you ever tried running git log on one of your old projects to see the "weird" commit messages you have used since its inception? It can be hard to understand why you made some changes in the past, and you'll wish you read this article earlier :).
Commit messages can adequately communicate why a change was made, and understanding that makes development and collaboration more efficient.
The most important part of a commit message is that it should be clear and meaningful. In the long run, writing good commit messages shows how much of a collaborator you are. The benefits of writing good commit messages are not only limited to your team, but indeed expand to yourself and future contributors.