Skip to content

Instantly share code, notes, and snippets.

@SunRunAway
Created June 26, 2019 09:17
Show Gist options
  • Save SunRunAway/b37c239dd23f157ed328f177d67980c5 to your computer and use it in GitHub Desktop.
Save SunRunAway/b37c239dd23f157ed328f177d67980c5 to your computer and use it in GitHub Desktop.
Use `git pr` to quickly send a pull request in browser.
#!/bin/bash
# put this file in your $PATH
# and chmod +x git-pr
# then use `git pr` in one github repo
repo=`git remote -v | grep push | grep origin | sed -e "s/.*github.com[:/]\(.*\)\.git.*/\1/"`
branch=`git name-rev --name-only HEAD`
echo "... creating pull request for branch \"$branch\" in \"$repo\""
open https://github.com/$repo/pull/new/$branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment