Last active
December 14, 2015 07:09
-
-
Save saranrapjs/5048882 to your computer and use it in GitHub Desktop.
Point yer browser to your latest Git commit on Github.com. Add to your .gitconfig. I'm usen "open" which is Mac-specific syntax to open in browser (I believe?) With kudos to http://dropshado.ws/post/4964571254/git-remote-show-origin
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
LATEST=$(git rev-parse HEAD) && REMOTE=$(git remote show -n origin | perl -ne '/Fetch URL: .*github\.com[:\/](.*\/.*)\.git/ && print $1') && FULL='https://github.com/'$REMOTE'/commit/'$LATEST && open $FULL | |
# added to your .gitconfig as an alias like so: | |
# [alias] | |
# point = !LATEST=$(git rev-parse HEAD);REMOTE=$(git remote show -n origin | perl -ne '/Fetch URL: .*github\.com[:\/](.*\/.*)\.git/ && print $1');FULL="https://github.com/"$REMOTE"/commit/"$LATEST;open $FULL; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment