Created
February 9, 2022 18:58
-
-
Save dciccale/43df138f3e82c363150c61ec45b10641 to your computer and use it in GitHub Desktop.
bash alias to open a pull request on github
This file contains 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
pr() { | |
local _open=$(if [[ `uname -s` == "Linux" ]]; then echo "xdg-open"; else echo "open"; fi) | |
local repo=`git config --get remote.origin.url | sed -e "s/.*github.com[:/]\(.*\)\.git.*/\1/"` | |
local branch=`git rev-parse --abbrev-ref HEAD` | |
$_open https://github.com/$repo/pull/new/$branch | |
} |
This file contains 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
pr() { | |
local _open=$(if [[ `uname -s` == "Linux" ]]; then echo "xdg-open"; else echo "open"; fi) | |
local repo=`git config --get remote.origin.url | sed -e "s/.*github.com[:/]\(.*\)\.git.*/\1/"` | |
local branch=`git rev-parse --abbrev-ref HEAD` | |
$_open https://github.com/$repo/pull/new/$branch | |
} |
This file contains 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
#!/bin/bash | |
_open=$(if [ `uname -s` == "Linux" ]; then echo "xdg-open"; else echo "open"; fi) | |
repo=`git config --get remote.origin.url | sed -e "s/.*github.com[:/]\(.*\)\.git.*/\1/"` | |
branch=`git rev-parse --abbrev-ref HEAD` | |
$_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