Skip to content

Instantly share code, notes, and snippets.

@miguelmota
Created July 11, 2019 20:51
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 miguelmota/cd9cb75fefd9ab9dc913b3ada8ae26d1 to your computer and use it in GitHub Desktop.
Save miguelmota/cd9cb75fefd9ab9dc913b3ada8ae26d1 to your computer and use it in GitHub Desktop.
Git (hub) github pull-request merge git extension
#!/bin/bash
# Usage: hub-pr-merge <PR-NUMBER>
#
# Cause a pull request to be merged into its respective base branch.
# If a script errors, force the script to fail immediately.
set -e
ID=$1
shift 1
# https://developer.github.com/v3/pulls/#merge-a-pull-request-merge-button
hub api -XPUT "repos/{owner}/{repo}/pulls/$ID/merge" "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment