Skip to content

Instantly share code, notes, and snippets.

@CoralineAda
Last active December 19, 2015 19:18
Show Gist options
  • Save CoralineAda/6004772 to your computer and use it in GitHub Desktop.
Save CoralineAda/6004772 to your computer and use it in GitHub Desktop.
Open your current git repo on GitHub from the command line. Recommend setting it as an alias in your ~/.bash_profile. Thanks to Zander (https://github.com/zph) for the assist (based on https://gist.github.com/zph/6b0171954c36146e307e, a shell version in progress.)
git config --get remote.origin.url | ruby -ne 'puts %{https://github.com/#{$_.split(/.com[\:\/]/)[-1].gsub(".git","")}}' | xargs open
@baweaver
Copy link

baweaver commented May 5, 2014

https://github.com/baweaver/special-sauce/blob/master/.zprofile#L106

More succinct:

open_repo () { launchy "`git config --get remote.origin.url | sed 's/\.git//'`" }

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