Skip to content

Instantly share code, notes, and snippets.

@andyvanee
Created July 9, 2014 20:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andyvanee/20304060c56c2da56e4b to your computer and use it in GitHub Desktop.
Save andyvanee/20304060c56c2da56e4b to your computer and use it in GitHub Desktop.
Alias to open the first github.com remote from the current directory in a browser
github(){
open `git remote -v | grep github.com | head -n 1 | cut -f 2 | cut -d' ' -f 1 | sed 's/git@/http:\/\//' | sed 's/.git$//' | sed 's/github.com:/github.com\//'`
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment