Last Updated: February 25, 2016
· lorin

Open GitHub to a specific commit

Here's a zsh function that uses hub to open your browser to show a specific commit on github.

function commit
    repo=$(git remote show origin -n | grep "Fetch URL" | sed 's/.*:\(.*\)\.git/\1/')
    hub browse $repo commit/$1

Invoke it like this, from inside a git-managed directory :

$ commit 4a8c4f889b