Skip to content

Instantly share code, notes, and snippets.

@grahamgilchrist
Created April 25, 2014 10:25
Show Gist options
  • Save grahamgilchrist/11284766 to your computer and use it in GitHub Desktop.
Save grahamgilchrist/11284766 to your computer and use it in GitHub Desktop.
Pull latest master and merge it to branch
#!/bin/bash
# usage: git-push-master branchname
# script to pull the latest master of current repo and merge it into the specified branch and push that branch back to the remote
set -x #echo on
BRANCHNAME=$1
git checkout master
git pull
git checkout $BRANCHNAME
git merge master --no-edit
git push
git checkout master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment