Skip to content

Instantly share code, notes, and snippets.

@todb-r7
Last active December 16, 2015 12:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save todb-r7/5438391 to your computer and use it in GitHub Desktop.
Save todb-r7/5438391 to your computer and use it in GitHub Desktop.
Git config aliases
[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
Copy link
Author

todb-r7 commented Apr 22, 2013

This should be more general -- it should be easy(?) to automatically fill in the todb-r7 username and the metasploit-framework repo name.

@kernelsmith
Copy link

@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

@kernelsmith
Copy link

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