Skip to content

Instantly share code, notes, and snippets.

View lukemoderwell's full-sized avatar

Luke Moderwell lukemoderwell

View GitHub Profile
@lukemoderwell
lukemoderwell / autopicker.sh
Last active January 15, 2019 21:30
A simple bash script that automates the process of "hotfixing" or cherry-picking commits through branches. It creates unique branches so that you can merge only what need.
#!/usr/bin/env bash
autopick() {
git fetch --all &&
git checkout release &&
git pull &&
git submodule update &&
git checkout -b hotfix/rel-$2 &&
git cherry-pick $1 &&
git push -u origin hotfix/rel-$2 &&
git checkout master &&
@lukemoderwell
lukemoderwell / hotfix.md
Created November 26, 2018 15:10
How To Hotfix

Hotfixing is pretty simple but moving commits between different branches can get a little hairy if you're not careful. The trouble we often experience usually results from not paying attention to which branch you're on when you create the commits.

The following steps outline a recommended approach which should reduce any confusion or potential for regression.

  1. Fetch all upstream updates from the remote (e.g. Github)
$ git fetch --all 
$ git pull --all