Skip to content

Instantly share code, notes, and snippets.

@kublaj
Forked from jhafner/git-open.sh
Created May 31, 2016 11:03
Show Gist options
  • Save kublaj/54f74a7fd7061e4eb235534f3fa71b28 to your computer and use it in GitHub Desktop.
Save kublaj/54f74a7fd7061e4eb235534f3fa71b28 to your computer and use it in GitHub Desktop.
Open the current repo on Github. Script by Brian Edgerton.
#!/bin/bash
git_host='[email protected]:'
git_url='https://github.com/'
remote=`git config --get remote.origin.url`
host=${remote:0:15}
if [ $host = $git_host ]
then
url=${remote/$git_host/$git_url}
open $url
else
echo "Repo does not have a Github origin"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment