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/common/bin/grb

13 lines
271 B
Plaintext
Raw Normal View History

2018-11-08 07:32:36 -06:00
#!/usr/bin/env bash
MAIN_BRANCH="master"
CUR_BRANCH="$(git branch | grep '\*' | cut -d ' ' -f2-)"
2020-04-20 10:38:19 -05:00
if [[ -n ${2+x} ]]; then
2018-11-08 07:32:36 -06:00
MAIN_BRANCH="$2"
CUR_BRANCH="$1"
2020-04-20 10:38:19 -05:00
elif [[ -n ${1+x} ]]; then
2018-11-08 07:32:36 -06:00
MAIN_BRANCH="$1"
fi
git rebase -i "$(git merge-base "$CUR_BRANCH" "$MAIN_BRANCH")"