Last active
September 3, 2019 21:33
-
-
Save anthager/ab94517b4680363d88fbebe8f0140c93 to your computer and use it in GitHub Desktop.
Bash function for opening the url of a new pr of the current branch in the current repo, perfect for .(zsh|bash)rc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| gcpr() { | |
| if ! git remote show origin -n &>/dev/null; then | |
| echo Not a repo m8 | |
| return 1 | |
| fi | |
| open "https://github.com/$(git remote show origin -n | grep "Fetch URL:" | cut -d : -f 3 | cut -d . -f 1)/pull/new/$(git rev-parse --abbrev-ref HEAD)" | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment