Browse your current repo on github.com
The http://defunkt.io/hub/ git wrapper was bogging down my console, and the only part of it I really used was git browse
. So I slapped this thing together. It figures out the URL for the git repo and branch you are currently on, and points your default browser in that direction.
repo = `git config --get remote.origin.url`.strip
branch = `git branch | sed -n '/\* /s///p'`.strip
repo_url = repo.sub(':', '/').sub('git@', 'https://').sub('.git', '')
repo_url = "#{repo_url}/tree/#{branch}"
puts repo_url
`open #{repo_url}`
Alias it from your .bash_profile
or somesuch, yo.
Written by Thomas Drevon
Related protips
2 Responses
See also: http://owenou.com/gh/
over 1 year ago
·
@afeld Thanks for the tip! Will check it out!
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#