Skip to content

Instantly share code, notes, and snippets.

@ilhnctn
Created December 13, 2018 14:03
Show Gist options
  • Save ilhnctn/4b108ce63bec991a6fba8c6a95ba4966 to your computer and use it in GitHub Desktop.
Save ilhnctn/4b108ce63bec991a6fba8c6a95ba4966 to your computer and use it in GitHub Desktop.
fetches master and merge into the branch passed as parameter
master_merge(){
TARGET_BRANCH = $1
if [[ $# -eq 0 ]] ; then
echo "\033[41;37;1m Usage: mm name_of_branch !!! \033[0m"
exit(1)
fi
echo "\033[41;37;1m Fetch/pull master and merge into $TARGET_BRANCH !!! \033[0m"
git checkout master
git pull
git checkout $TARGET_BRANCH
echo "\033[41;37;1m Fetched master and merged into $TARGET_BRANCH \033[0m"
git status
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment