Last active
December 16, 2015 12:59
-
-
Save todb-r7/5438391 to your computer and use it in GitHub Desktop.
Git config aliases
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
[alias] | |
branch-current = rev-parse --abbrev-ref HEAD | |
# Usage: git-pr HISNAME HISBRANCH | |
# Example: git-pr rapid7 master | |
# Example: git-pr JoeContributor bug/his-fix-for-a-bug-that-you-fixed | |
pr-url =!"xdg-open https://github.com/todb-r7/metasploit-framework/pull/new/$1:$2...$(git branch-current) #" | |
@todb-r7, I forked this gist and added the code to grab the username and repo name automatically, but I can't see how to do a PR to your gist... so it's here: https://gist.github.com/kernelsmith/7449293
ultimately, just change the last line to
pr-url =!"xdg-open https://github.com/$(git config user.name)/$(basename $(git rev-parse --show-toplevel))/pull/new/$1:$2...$(git branch-current) #"
also, should the usage and examples be: git pr-url HName HBranch etc not git-pr ?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This should be more general -- it should be easy(?) to automatically fill in the todb-r7 username and the metasploit-framework repo name.