Created
July 5, 2021 21:28
-
-
Save tpjnorton/b4e3d748268cccc658bb1061878000d2 to your computer and use it in GitHub Desktop.
A quick bash function for updating Gitflow branches.
This file contains 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
# usage: rbs [-m] -b base_branch_name | |
function rbs() { | |
OPTIND=1 | |
BASE_BRANCH=develop | |
UPDATE_ACTION=rebase | |
while getopts "b:m" flag; do | |
case "${flag}" in | |
b) BASE_BRANCH=${OPTARG} ;; | |
m) UPDATE_ACTION=merge ;; | |
esac | |
done | |
git checkout ${BASE_BRANCH} && git pull && git checkout - && git ${UPDATE_ACTION} ${BASE_BRANCH} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment