Shoppers Stop sees 2X jump in CRM revenue contribution with WebEngage. You can too. Take a demo now!

2 Mins Read

3,031 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

We approached WebEngage when we were unhappy with a competitor's product. We wanted excellent service, which is one of WebEngage's intrinsic values. From Oberoi Hotels & EazyDiner to The Postcard Hotel, we're a 100% WebEngage client!

Kapil Chopra

Founder - EazyDiner & The PostCard hotel

Global brands trust WebEngage

global-brands
reviews-security-partners

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