-
-
Save kernelsmith/7449293 to your computer and use it in GitHub Desktop.
git alias for pr-url to open a browser with a PR to the intended user and branch
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
[user] | |
uname = ks | |
[alias] | |
branch-current = rev-parse --abbrev-ref HEAD | |
# Usage: git pr-url HISNAME HISBRANCH | |
# Example: git pr-url rapid7 master | |
# Example: git pr-url OJ feature/cool_feature_that_also_fixes_bugs | |
pr-url =!"xdg-open https://github.com/$(git config user.uname)/$(basename $(git rev-parse --show-toplevel))/pull/new/$1:$2...$(git branch-current) #" | |
# OSX. Use whatever browser you use | |
#pr-url =!"open -a \"Google Chrome\" https://github.com/$(git config user.uname)/$(basename $(git rev-parse --show-toplevel))/pull/new/$1:$2...$(git branch-current) #" | |
# NOTE: you may be able to use config user.name if that matches your username |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Slightly santized dotfiles are here: https://github.com/todb/junkdrawer/tree/master/dotfiles/git-repos