Last active
December 6, 2019 19:07
-
-
Save robertpro/684deeb81e8a6f84ec9e456094fad262 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BASE_BRANCH="upgrade" | |
BRANCH=$1 | |
show_help() { | |
echo "./${0} BRANCH_NAME" | |
exit 1 | |
} | |
if ! [[ "$BRANCH" ]]; then | |
show_help | |
fi | |
git checkout $BASE_BRANCH | |
git pull | |
if ! git checkout "${BRANCH}"; then | |
echo "Branch '${BRANCH}' does not exist." | |
show_help | |
fi | |
git pull | |
git rebase $BASE_BRANCH | |
git push -f | |
git checkout $BASE_BRANCH | |
# shellcheck disable=SC2063 | |
git branch | grep "*" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment