Skip to content

Instantly share code, notes, and snippets.

@kormat
Last active June 16, 2017 10:43
Show Gist options
  • Save kormat/2bd88d965497bc54c988 to your computer and use it in GitHub Desktop.
Save kormat/2bd88d965497bc54c988 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -e
COLOR=$(tput setaf 12)
RESET=$(tput sgr0)
log() {
echo "$COLOR=======> $@ $RESET"
}
log "Switching to master branch"
git checkout master
log "Fetching upstream"
git fetch --prune --multiple upstream origin
log "Updating master"
git merge --ff-only upstream/master master
git push
log "Merged branches:"
git branch --merged
log "Done"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment