5 Types of Git WorkFlow & Explanation of each Flow

As you might be aware, each team has its own unique workflow based on the project type, size of the company, team preferences, and a number of other factors. The larger the team, the more difficult it is to keep things under control: disputes become more regular, delivery deadlines may postpone, priorities always change - the list may go on and on.

Adapting Git is the first step in resolving these challenges, as it can be used in almost any workflow. Here are the five most common Git workflows that you can use in your company.

1. Basic

The concept is straightforward: there is a single central repository. Each developer clones the repository, works on the code locally, commits the changes, and pushes it to the central repository for other developers to grab and use.

2. Feature Branches

This is where Git’s primary feature, branches, comes in handy. Branches are separate project development “tracks.” A new branch should be generated for each new functionality, where the new feature is built and tested. When the feature is complete, merge the branch with the master branch and push it to the production server.

3. Gitfow

The larger the project, the more the requirement for control over what and when it is released. More unit and integration tests are required in your projects, which now take hours to complete. However, similar tests are not done on branches when features are being created.

This workflow employs two parallel long-running branches:

a. Master: Only the master is used for releases.

b. Develop:This is the home of all completed and stable features ready for the next release, which was developed from Master.

Create a new Feature branch from Develop when you start working on a new feature. Create as many feature branches as you like and need in concurrently. Return the code to Develop once the work is completed and the feature has been tested.

When it’s ready to release, create a separate Release branch and isolate the new features from the Develop branch. Ascertain that the release has been thoroughly tested and is stable.

4. Feature Branches and Merge requests

The feature branch workflow considers that all team members have the same level of expertise and authority. However, in larger groups, there is always some type of company hierarchy.

In this instance, merge requests and push permissions can be used to limit pushing to specific branches in the repository while maintaining complete control over the code.

5. Forking workflow

When a developer needs to make a change to an open-source project, they don’t work on the repository directly. Instead, they fork it, thus making a duplicate of the repository. The developer is then free to work on the new functionality in whatever way they like. It’s also worth noting that forking allows for the creation of unique versions of particular components tailored to specific applications. A developer or a firm can fork a repository and take the code in a completely different route than the owner would allow (s).

Enjoyed this article? Share it.

Shyam Mohan

DevOps Engineer

Shyam Mohan is a DevOps Engineer and he has 14+ years of experience in the areas of Software Development, Devops, CI/CD, Kubernetes, and he also guides companies to adopt CI/CD pipelines which will help them to automate their workflow.

Upcoming Webinar

How to secure Kubernetes and secrets management- Part 2.

29th October,2022

11:30 AM IST

Register Now

Want to setup CI/CD in a more complex app?

Request a Demo