Discover The Automated Market Makers In The CRYPTO Industry In 2022

Instead of a traditional market of producers and customers, automated market makers (AMMs) employ liquidity pools to allow digital assets to be transferred without consent and automatically. On a…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Managing a Better Git Workflow

It is hard to manage a large codebase, especially with the large teams with many developers. To increase the code quality and team efficiency, a robust git workflow is the essential practice for the team.

In this article, we will make use of those technique to help shaping up the idea how to build up a better git workflow.

Especially for a large team, developers always be divided into different small teams, each team will keep developing features and finally merge their codes into a central branch, usually a develop branch. Since every teams are working on their own private branch, different teams may work on the same line of codes or amend project dependencies. Once the codes merge into the central branch, it may have merge conflicts. If the team cannot handle the merge conflicts well, the whole project may get stuck.

What do we need with the good git workflow? To ensure code quality, large team should discuss together to setup some best practices for the team.

Firstly, the whole team should follow the same code styles. Code Styles is like the grammer of the languages, developers should follow the code style guide to write their codes.

Use mobile development as an example, there are some code styles guides:

There are some other open source guides on GitHub, discussing with your teammates to build up the most approapriate guides for the whole team.

Secondly, choosing the git workflow and git practices.

Pull Request is a great practice to protect the main branch from code pollution . With the practices like code review, teams can ensure code quality by keeping at least two people on same piece of codes. Moreover, by enabling automated pull request unit test, teams can have much more confidence with the code safety.

This blog post shows how clean the commit history is after using git rebase.

Finally, the branching strategy.

For the general agile software development cycle, dev team will start with a sprint kick-off meeting. All members in the team have to agree all the checkout branches for the sprint after sprint kick-off meeting. Everyone will take up some tasks and team can foresee what branches need to checkout.

User stories and tasks should be classified as features or hot-fixes. Thus, corresponding feature branches, hot-fixes branches will be planned and assigned to corresponding engineers.

Depending on the culture of the team, there should be one or more engineers to be the owner of the develop/release branch, usaually is the technical lead engineer or an experienced one. The roles for these people is to ensure all commits merging to develop/release branches should be reviewed or passed the automated testings if there is in the development pipeline. The owner is the one to do code review for all pull requests to the protected branches (develop/release branch).

Once the engineers complete codings in their feature branch, firstly, they do is to tidy up the comments of their commits by git rebase.

For more info about git rebase using command line and Sourcetree, checkout these.

Secondly, fetch the develop branch to check whether there are changes upstream. If there are changes, engineers need to rebase the local changes on the upstream’s commits. It is important to do it in local branch to protect the upstream one from pollution. And this is the safe place to resolve merge conflicts.

Lastly, pushing the local feature branch to remote origin. Filing the pull request to team lead which is the owner of the developer branch.

Master, Develop and Release branches are common protected branches. Codes cannot freely be merged into these branches. Experienced developers like team lead should be the owner of these branches to watch for any unapproved commits.

Branch owners also need to review pull requests to approve commits to merge into the protected branch. The owners have right to reject the pull request based on some predefined organization internal rules. For example, owners can reject codes without following style guides, or codes without rebasing.

A better git workflow is an essential tool to support good code quality and hence a good product. I hope that I can bring out some ideas to inspire your team to build up your own workflow.

Add a comment

Related posts:

Player Unknown Battle Grounds

Player Unknown Battle Grounds or better known as PUBG is a multi-player survival of the fittest styled game. There is only one goal in this game, to be the last one standing out of a group of…

IOTA greets its new member to its development and research team

IOTA Foundation has included a new member in its development and research team. Michael Nati has joined the team, bringing on-board his in-depth technical knowledge and multi-sector exposure to the…

Brief Introduction To Set In Javascript

Set are Object added in ES6. This allow you to store only unique values in it. You can not add duplicate values in it. So let’s begin without wasting more time. You have successfully created a Set…