Skip to content

Instantly share code, notes, and snippets.

@netroy
Created August 15, 2014 12:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save netroy/a7a6043ca579fcc902f9 to your computer and use it in GitHub Desktop.
Save netroy/a7a6043ca579fcc902f9 to your computer and use it in GitHub Desktop.
  • add this to your zshrc, or bashrc
  • go to a repo directory
  • find a PR to merge (eg: 1736)
  • run merge_pr 1736 to rebase & merge automagically to nightly branch
merge_pr () {
git branch -D pr-$1
git fetch origin refs/pull/$1/head:pr-$1
git checkout pr-$1
git rebase origin/nightly
git branch -D nightly
git checkout nightly
git merge pr-$1 --ff-only
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment