Created
April 18, 2016 10:59
-
-
Save frm/a34a5ab2011cfedb59309171bd256186 to your computer and use it in GitHub Desktop.
Opening git repo in browser
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 | |
# Latest version probably in my dotfiles repo | |
if [[ $# -eq 0 ]]; then | |
DIR=. | |
else | |
DIR=$1 | |
fi | |
# Use --git-dir=$DIR/.git if git version < 1.8.5 | |
open $(git -C $DIR remote -v \ | |
| awk '/fetch/ { print $2 }' \ | |
| sed -e 's/:/\//' \ | |
-e 's/git@/https:\/\//' \ | |
-e 's/\.git$//') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment