Skip to content

Instantly share code, notes, and snippets.

@botanicus
Created November 16, 2010 14:45
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save botanicus/701891 to your computer and use it in GitHub Desktop.
Save botanicus/701891 to your computer and use it in GitHub Desktop.
ZSH: gh_open for opening current repo's page in browser.
# Open GitHub page for the current repository.
#
# Example:
# $ git clone https://github.com/majek/puka.git
# $ cd puka
# $ gh_open # Browser: https://github.com/majek/puka
function gh_open {
open $(git config remote.origin.url | ruby -ne 'puts "https://" + $_.split(%r{[/:@]})[1..-1].join("/").sub(/\.git$/, "")')
}
@alextrastero
Copy link

Very useful thanks

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