Skip to content

Instantly share code, notes, and snippets.

@lowsky
Forked from dschneller/OpenInGithub
Created May 16, 2014 07:33
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 lowsky/0b4e612e5d2fa7c6f3a5 to your computer and use it in GitHub Desktop.
Save lowsky/0b4e612e5d2fa7c6f3a5 to your computer and use it in GitHub Desktop.
#!/bin/bash -x
REPO="${1}"
SHA1="${2}"
repofragment=$(cd "$REPO"; git remote -v | grep origin | grep push | sed -e 's/.*github\.com.\(.*\)\.git.*/\1/')
url="https://github.com/${repofragment}/commit/${SHA1}"
open "$url"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment