Created
August 14, 2014 11:06
-
-
Save codeinthehole/62bc2010cc059aa12ff7 to your computer and use it in GitHub Desktop.
Git aliases for quickly opening Github pages
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] | |
# Open the Github page for the... | |
# ...repo homepage (included for consistency) | |
open = !hub browse -- | |
# ...repo commits | |
opencommits = !hub browse -- commits | |
# ...commit page for HEAD | |
openhead = !hub browse -- commit/$(git rev-parse HEAD) | |
# ...commit page for a passed SHA (defaults to HEAD) | |
opencommit = "!f() { sha=$(git rev-parse ${1:-HEAD}); hub browse -- commit/$sha; }; f" | |
# ...blame page for the passed file (a line number/range can be passed in too) | |
openblame = "!f() { sha=$(git log --format='%h' -1 $1); hub browse -- blame/$sha/$1#L$2; }; f" | |
# ...commit history page for the passed file | |
openhistory = "!f() { sha=$(git log --format='%h' -1 $1); hub browse -- commits/$sha/$1; }; f" | |
# ...repo issues | |
issues = !hub browse -- issues | |
# ...repo pull requests | |
pulls = !hub browse -- pulls | |
# ...repo wiki | |
wiki = !hub browse -- wiki | |
# ...repo settings | |
settings = !hub browse -- settings | |
# ...repo branches | |
branches = !hub browse -- branches | |
# ...repo branches | |
releases = !hub browse -- releases |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment