Skip to content

Instantly share code, notes, and snippets.

@pateketrueke
Created August 14, 2012 16:07
Show Gist options
  • Save pateketrueke/3350522 to your computer and use it in GitHub Desktop.
Save pateketrueke/3350522 to your computer and use it in GitHub Desktop.
Open remote GitHub repository URL
hub(){
REPO="$(git remote -v | grep fetch | sed 's/origin//' | tr ':' '/' | sed 's/.*git@/http:\/\//' | sed 's/.git *([a-z]*)//')"
if [ "$(whereis xdg-open)" ] ; then
cmd="xdg-open"
else
cmd="open"
fi
$cmd "$REPO"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment