Created
July 31, 2013 18:02
-
-
Save derryl/6124475 to your computer and use it in GitHub Desktop.
Opens the GitHub website for the repo currently being viewed in Bash
This file contains hidden or 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
#!/bin/sh | |
function gh() { | |
giturl=$(git config --get remote.origin.url) | |
if [ "$giturl" == "" ] | |
then | |
echo "Not a git repository or no remote.origin.url set" | |
exit 1; | |
fi | |
giturl=${giturl/git\@github\.com\:/https://github.com/} | |
giturl=${giturl/\.git//} | |
echo $giturl | |
open $giturl | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment