Version control - brightstudent/backend GitHub Wiki

Version control

Version control is a system that keeps track of changes in files over a period of time. There are numerous benefits to adopting version control, including the ability to quickly recover previous versions, compare newer versions to previous ones, and determine who is the last person that edited the project. There are various types of version control, however I'll be using Distributed Version Control Systems (DVCSs). DVCS allows you not only to access the most recent modifications, but also makes it possible to obtain the repository's whole history. That’s very handy in case a server fails. Because any of the client repositories can be sent to the server to recover it. Each clone is actually a full backup of all data.

How will I be using it

For my project I'll be using Github as my DVCS. This is a well-known and widely used program in the industry. I'm going to utilize the command line to commit and push files since I believe it's the quickest method to learn how to use version control. Also it's much more time efficient than using the GUI. I won't be using branches at the moment, since all the changes are made by me and also only on my machine. But using branches will become crucial when we start working in teams.

Commits

The purpose of a commit message is to summarize the changes made to the code. This summary should help you and your team understand what is happening during the course of development. The information we put in a message should therefore be valuable and useful to the people who will be reading it, including yourself.

Chris Beams advices the following steps for achieving this:

  1. Separate subject from body with a blank line
  2. Limit the subject line to 50 characters
  3. Capitalize the subject line
  4. Do not end the subject line with a period
  5. Use the imperative mood in the subject line
  6. Wrap the body at 72 characters
  7. Use the body to explain what and why vs. how

GitHub provides ways to see what has changed in a commit. A good commit message is a summary message of what has changed. The log message is arguably the most important part of a commit, because it's the only place that states not only what changed, but why did it change.