5 Version Control Best Practices to Enhance Team Collaboration

Asif Imtiaz Ahmed
4 min readMay 2, 2021
GitLab — Unsplash

The current fast-paced application development industry can be very demanding and requires many developers to collaborate together and work in their own asynchronous environments. Version control using GitHub allows a very seamless way to collaborate and develop applications, while testing, tracking changes, and sharing feedback.

Here are five things suggested by GitLabs to enhance your team collaboration and incorporate some best case practices.

1. Determine a branching strategy

source: unsplash.com

It is essential to have a workflow set up for teams of devs to be able to collaborate effectively. Therefore following the right strategy for branching the project is essential.

Before settling on a strategy you must look at team size, level of experience, and scale of the project. For example, in Flutter an open-source, cross-platform application development framework by Google, the top-level branches for development are: master -> dev -> beta -> stable(release).

All the issues that get worked on are pull requested to the master branch. Then they are tested as extensively as possible, bugs resolved, and then requested to get pulled into the dev branch. Here they will still be tested and upgraded till they are ready for release and then they get pull requested to beta, this branch will have more tests and usually stays for some time to ensure no bad builds occur in this branch, and finally will be deemed to get pulled on to the stable branch which is readily updated (released) to all end users. This type of structure is known as GitFlow.

Some Such Strategies:

Centralized Workflow

A single master branch where all developers commit changes. This can get a bit confusing, so it is only suitable for teams with less than 5 members who are in:

  • Constant communication with each other
  • Never work on the same code simultaneously

Feature Branching

This is where there are many new features that need to be implemented and so a branch is designated for each individual feature. This is ideal for big projects requiring a multitude of teams working on different features.

GitFlow

This is a more advanced version of the feature branch where each branch can have its own separate branches for features, hotfixes, release, etc. This is also ideal for large groups of developers and teams collaborating on a project.

Task-Branch Development

This is a feature-based strategy where each feature of the application is branched out into several different branches such as testing, pre-production, and several other small task-based branches that complete the feature. This branch creates a fast development pace and so developers must complete each task (which are usually very small pieces of the whole feature) and send them upstream to merge and complete the feature. GitLab Flow is an example of such a strategy.

2. Make Frequent, Small Changes

source: unsplash.com

Teams frequently end up getting into the habit of making in-frequent large commits. This creates a risk of developing and spending time on the wrong feature and going in the wrong direction.

Getting into a culture of frequent commits allows everyone to be aware of what everybody else is working on. This will also prevent duplication of work. This also makes reverting a commit easier, to identify bugs.

3. Write Descriptive Commit Messages

source: unsplash.com

Commit messages can allow team members, customers, and future contributors to get a level of transparency that enables good understanding and clarity. Descriptive messages should also follow a kind of convention across the teams to reduce confusion.

for example:

Instead of “Improved XML generation” could be better written as “Properly escape special characters in XML generation”

4. Develop Using Branches

source: gitlab

Coding in branches enables a more organized approach to development. This keeps the work in progress as a separate draft away from a stable, master channel. This depends on the strategy that you picked for your project.

5. Conduct Code Reviews

source: gitlab

Code reviews are a great way to learn and streamline all the code that is being written for any project. All team members should be encouraged to look at other codes and provide suggestions to create a more stable codebase.

A good practice is, as soon as there is any code to review, a team member should assign the code review to an individual who is familiar with the project. This is also a very good practice to identify bugs, logic problems, or uncover edge cases.

Resources:

--

--

Asif Imtiaz Ahmed

Flutter Developer pursuing my passion in building ideas into apps. Aspiring writer and trying to hone my skills in this ever changing world.