Skip to content

Instantly share code, notes, and snippets.

@dciccale
Created February 9, 2022 18:58
Show Gist options
  • Select an option

  • Save dciccale/43df138f3e82c363150c61ec45b10641 to your computer and use it in GitHub Desktop.

Select an option

Save dciccale/43df138f3e82c363150c61ec45b10641 to your computer and use it in GitHub Desktop.

Revisions

  1. dciccale created this gist Feb 9, 2022.
    6 changes: 6 additions & 0 deletions .bashrc
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    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
    }
    6 changes: 6 additions & 0 deletions .zshrc
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    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
    }
    5 changes: 5 additions & 0 deletions pr.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    #!/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