Drop the following script into your path somewhere, I keep it in ~/bin
.
Then add a git alias for bro
git config --global alias.bro !git-browse
Drop the following script into your path somewhere, I keep it in ~/bin
.
Then add a git alias for bro
git config --global alias.bro !git-browse
#!/usr/bin/env ruby | |
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/, '\1') | |
repo_url = "#{repo_url}/tree/#{branch}" | |
`open #{repo_url}` |