Sunday, September 10, 2017

Git Commit Messages

Why Messages ?



Git is a Version-Control system to track the  changes to the files in your computer. It is a tool to control and keep track of the changes to software products.  Git Commit  is where you put some specific changes to files into the Git Local Repository.  It is compulsory to put message when you do a Git-Commit. 

A message is a communication  medium. What are we going to communicate through a 'Git-Message' ? Is it really important to put a message to a commit ? To whom are we going to communicate ? 

When talking about git we always remember a software-project where multiple developers are working. So, a commit-message is going to communicate the group of developers about what has been changed in the project. In a software project a group of people works to achieve a common goal. So, it is really important to all of them to know what has happened to the project. But the message should be much more meaningful and descriptive. 

Some Standards


If we search internet we could find some standard ways to put git-messages. In this article I would cover some basic standards which I use. 

A change to the software project can be a new-feature, update to an existing feature or a bug-fix. So, if you to write a commit message it would be much easier to others if we could let them know to which category of above was the change belongs to. So, when you write a message always start it with either one of these three prefixes. 
  1. New : (if a change was a new feature)
  2. Fix : (if change is a bug fix)
  3. Update :  (if change is an update to an existing feature)
After the  prefix then put a semi-colon and write your message. After the message you have to convey whether the change is finished or not. If the change is finished put a full-stop (.) after the message. If the change is unfinished you can put a comma (,) and wip which stands for 'work in progress'. 

Eg : 
       Fix : Login Page changed.
       New : User registration validation added, wip

No comments:

Post a Comment