Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


"gh open" without any args opens up the current repo page #88

wants to merge 1 commit into from

1 participant


Right now, gh open (no args) will lead us to the github top page. It is rather useless.

With this change, the same command will bring us to the origin's top page, when and only when you're in the repo's directory. If you're not in any repo, defaults to the previous behavior - go to

It is convenient when you have a prettified as a quick reference for the project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 13, 2012
  1. @kenn
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 0 deletions.
  1. +6 −0 lib/commands/commands.rb
6 lib/commands/commands.rb
@@ -46,6 +46,12 @@
desc 'Open the given user/project in a web browser'
usage 'github open [user/project]'
command :open do |arg|
+ if arg.nil?
+ origin = git('remote -v').split("\n").find{|i| i =~ /^origin/ }
+ if origin
+ arg = origin.split(/\s/)[1].sub('','').sub('','').sub('.git','')
+ end
+ end "{arg}"
Something went wrong with that request. Please try again.