Skip to content

Instantly share code, notes, and snippets.

@BaseCase
Created February 22, 2013 06:19
Show Gist options
  • Select an option

  • Save BaseCase/5011141 to your computer and use it in GitHub Desktop.

Select an option

Save BaseCase/5011141 to your computer and use it in GitHub Desktop.
This script will open up the GitHub page in your web browser for the current git repo in your shell. It's aliased to 'gho' (GitHub Open) in my bash config. Change "github" on line 4 to whatever your GitHub remote is named (default is "origin").
#!/bin/bash
function github {
git remote show -n github |
grep Fetch |
cut -d @ -f 2 |
tr ':' '/' |
sed s/\.git// |
sed s#^#https://#
}
open `github`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment