-
-
Save DarrenN/62dbeac4820d2fbb1602 to your computer and use it in GitHub Desktop.
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 | |
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