Created
August 14, 2012 16:07
-
-
Save pateketrueke/3350522 to your computer and use it in GitHub Desktop.
Open remote GitHub repository URL
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
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