Sunday, May 2, 2021

How to write git commit message like a pro?

Usually most of the people write vague commit messages in their git repository. So let me give you a way by which you can write a commit message like a pro.

First of all, you need to think about the changes you have made in the repository. Then you'll get 3 questions:
  1. What changes have been made?
  2. Where those changes have been made?
  3. Why have you made those changes?

Now, let's see each one.


This refers to the actual code changes but each commit shows those changes by default in git repository. So we don't need to describe it.


This refers to the file in which code changed but each commit also show the list of updated files in git repository. So we don't need to describe it.


This refers to the reason due to which we have changed the code which can't be explained by git repository. So we should always need to describe it.


We don't need to describe what changed or where changed but why changed.

No comments:

Post a Comment