Skip to content

Instantly share code, notes, and snippets.

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 davejachimiak/6150800 to your computer and use it in GitHub Desktop.
Save davejachimiak/6150800 to your computer and use it in GitHub Desktop.
Get merge commit created by Github when you open a pull request from a branch (`my_branch`)
REMOTE_SHA=`git rev-parse origin/my_branch`
PULL_NUMBER=`git ls-remote origin | grep $REMOTE_SHA | grep pull | perl -n -e '/pull\/(.*)\/head/ && print $1'`
git ls-remote origin | grep refs\/pull\/$PULL_NUMBER\/merge | awk '{ print $1 };'
@davejachimiak
Copy link
Author

There's got to be an easier way to do this.

@aljachimiak
Copy link

Well, the second comment here is thought provoking: StackOverflow

@davejachimiak
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment