Skip to content

Instantly share code, notes, and snippets.

@kernelsmith
Forked from todb-r7/.gitconfig
Last active December 28, 2015 05:19
Show Gist options
  • Save kernelsmith/7449293 to your computer and use it in GitHub Desktop.
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
[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
@todb-r7
Copy link

todb-r7 commented Jan 2, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment