2 Mins Read

3,533 Views

Automating git flow hotfixes with git lava!

Home - Blog - Automating git flow hotfixes with git lava!

At WebEngage, we use git flow as the branching model for our code repositories. It is a very helpful git workflow for collaborative development (read more).

How we use git flow at WebEngage

Whenever we need something fixed quickly on production we start on a git flow hotfix. This involves a bunch of steps:

  • update master and develop branches from origin (we deploy from the master branch on production)
  • look for the last hotfix version in git log to determine the next version
  • create a hotfix branch from master
  • fix the issue and commit changes in the hotfix branch
  • complete the hotfix by merging commits in master and develop
  • create a tag pointing at the merge commit in master
  • push the commits to remote master and develop branches
  • push the tag to remote

To aid in creating hotfixes, some of us use the command line git extensions (cheatsheet) while others prefer Atlassian SourceTree with its built in git flow support.

Even then the process is rather time consuming (especially when we are fire-fighting) and error prone with people creating hotfixes with same version every now and then.

Say hello to git lava

An anecdote from NARKOZ/hacker-scripts
“If something – anything – requires more than 90 seconds of his time, he writes a script to automate that”.

Hence, we wrote git lava – a small automation script over git flow for creating hotfixes.

With git lava we simply checkout the master branch, make code changes for the fix, test it out locally and then execute ..

git lava "commit_message" 

git lava scans git log and finds the next hotfix version itself, starts hotfix, commits the changes, completes hotfix and pushes the commits and tag to remote.

It even has a rollback mechanism in case of errors.

Here’s a demo of how it works …

git lava is on GitHub. Please feel free to use and contribute.

Before you go, lemme tell you why we named it git lava?
Well, because it automates HOTfixes with git FLOW → HOT FLOW → lava :clap:

Thanks for stopping by.

Tags

Author

Co-founder and CEO, 

WebEngage

Avlesh is the co-founder and CEO at WebEngage. He occasionally writes here and on his personal blog.

Related Articles

Scroll to Top

“I like many things about WebEngage, but what stands out is their agility and being customer centric.”

Nitin Sethi,

SVP, CDO – Consumer Businesses

800+ Global brands trust WebEngage

brands-strip-demo

What to expect from the demo call?

Talk to the Partner Team

Supercharge Your Startup's Growth

Supercharge Your Startup's Growth

Book a free consultation

Supercharge Your Startup's Growth

The Program helped us scale our business faster and bring down acquisition costs with time.

ankit-agarwal-testimonial

Ankit Agarwal

Founder, PHOOL

Become a Partner

Grab your copy