Skip to content

Instantly share code, notes, and snippets.

@dciccale
Created February 9, 2022 18:58
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 dciccale/43df138f3e82c363150c61ec45b10641 to your computer and use it in GitHub Desktop.
Save dciccale/43df138f3e82c363150c61ec45b10641 to your computer and use it in GitHub Desktop.
bash alias to open a pull request on github
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
}
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
}
#!/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