Last active
February 14, 2020 21:33
-
-
Save bjtitus/c6747f26ecfcc17ad64e2c154c786ed9 to your computer and use it in GitHub Desktop.
Open current branch in 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
# For Bash or ZSH | |
function gh-pr() { | |
branch=`git rev-parse --abbrev-ref HEAD` | |
prNum=`gh pr list | grep '$branch' | grep -o '[0-9]\+' | head -1` | |
gh pr view $prNum | |
} |
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
function gh-pr --description 'Opens the current branch on Github.' | |
set branch (git rev-parse --abbrev-ref HEAD) | |
set prNum (gh pr list | grep '$branch' | grep -o '[0-9]\+' | head -1) | |
gh pr view $prNum | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment