#!/bin/sh if [ -z "$1" ] then echo "Branch name is missing" else # Go to relevant branch git checkout $1 # fetch everything git fetch #rebase interactive git rebase -i origin/master fi # See https://git-scm.com/docs/git-rebase