Skip to content

Instantly share code, notes, and snippets.

@jhafner
Created May 16, 2013 15:55
Embed
What would you like to do?
Open the current repo on Github. Script by Brian Edgerton.
#!/bin/bash
git_host='git@github.com:'
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
@jhafner
Copy link
Author

jhafner commented Jun 10, 2013

Also, I highly recommend the following in your .bash_profile:

alias go="git open.sh"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment