This repository has been archived on 2024-03-28. You can view files and clone it, but cannot push or open issues or pull requests.
dotfiles/scripts/bin/grb
Daniel Flanagan b5f99b9d7d WIP
2018-11-08 07:32:36 -06:00

12 lines
275 B
Bash
Executable file

#!/usr/bin/env bash
MAIN_BRANCH="master"
CUR_BRANCH="$(git branch | grep '\*' | cut -d ' ' -f2-)"
if [[ ! -z ${2+x} ]]; then
MAIN_BRANCH="$2"
CUR_BRANCH="$1"
elif [[ ! -z ${1+x} ]]; then
MAIN_BRANCH="$1"
fi
git rebase -i "$(git merge-base "$CUR_BRANCH" "$MAIN_BRANCH")"