What is Version Control System and Why Do We Need It?
VCS (Version Control System), also known as revision control or source control is a category of tools that help developers to keep track of changes to source and configuration (in case of configuration as code) code. It keeps track of any modification to code including all the meta-data associated. Protects source code from catastrophic events such as accidental deletion or sabotages. Source control is a life-saving tool, treated respectfully by all high performer teams. SVN, TFS, Git are popular ones substantially used in the industry.
Benefits of Version Control
Version Control is literally the base stone for DevOps transformation. It doesn’t only record the changes, but also help development team to achieve higher quality software and ship the product faster. Using right tool with best-practices provides tremendous benefits such as;
- Increased transparency
- Better collaboration
- Faster product delivery
Source control (in other words Version Control) records complete history of changes. That means, anyone who has access to the repository easily see by whom and when the changes are made. This level of information boosts transparency supporting collaboration.
For collaboration, benefits that source control offers are life-saving. First, version control enables everyone to work on his/her working copy and then reflect the changes on demand. If any conflict occurs, change owner examines the situation, reverser or commits again to solve the problem. Second, version control offers a mechanism called branching that allows developers to create a separate line of development. These lines are for different feature set mainly. When development on branches is finished, they should be merged to master.
Branching and Merging
In theory, there can be unlimited number of branches for a single offers. However, in practice, it is not allowed to increase number of branches for a long time. Even though they are created with a purpose, merging with main branch drastically decreases risk of conflicts on merge.
For branching, there are ways of usage called branching strategy. Feature Branching and Release Branching are widely used models to collaborate. A strong and consistent strategy contributes to team success tremendously.
Release Branching refers to the concept that a branch is used for release. When team starts working on a new release, a branch is created and all work done until the next release is stored in this branch. (i.e v0.1 or v.0.2 )
Feature Branching, which is often coupled with feature flags enabling and disabling a feature within the product, is used to collect requirements that can be merged into a master and deployed as one complete feature.
Source Code Management Best-Practices
- Commit Frequently
- Work on Latest Version
- Use Branches
- Provide Meaningful Commit Messages
- Integrate with Continuous Integration