Skip to content

Instantly share code, notes, and snippets.

@saranrapjs
Last active December 14, 2015 07:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save saranrapjs/5048882 to your computer and use it in GitHub Desktop.
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
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