Created
March 27, 2015 21:42
-
-
Save tylergaw/f9640c7f7050a206dced to your computer and use it in GitHub Desktop.
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
#!/bin/sh | |
git rev-parse 2>/dev/null | |
if [[ $? != 0 ]] | |
then | |
echo "Not a git repo" | |
return | |
fi | |
remote="origin" | |
if [ ! -z "$1" ] | |
then | |
remote="$1" | |
fi | |
remote_url="remote.${remote}.url" | |
giturl=$(git config --get $remote_url) | |
if [ -z "$giturl" ] | |
then | |
echo "$remote_url not set" | |
return | |
fi | |
giturl=${giturl/git\@github\.com\:/https://github.com/} | |
giturl=${giturl%\.git} | |
open $giturl | |
return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I drop this in my home folder and then have an alias in my bash_profile