g1y_uw
Last Updated: February 25, 2016
·
1.02K
· thomax
5bffc68193544939c79d113de6787538

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.

Say Thanks
Respond

2 Responses
Add your response

7470
5e6ceef905d14ade228ea22c445d57bc
over 1 year ago ·
7475
5bffc68193544939c79d113de6787538

@afeld Thanks for the tip! Will check it out!

over 1 year ago ·