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.