cd ~/some-project
gh
Now your default browser opens with github.com/path/to/some-project.
- Download
gh
script - Place somewhere in your
$PATH
to have it globally accessable
#!/usr/bin/env ruby | |
# vim: set ft=ruby | |
if Dir.exists?(".git") | |
repo_url = `git config remote.origin.url`.strip | |
if !repo_url.empty? and repo_url =~ /github\.com[:\/](.*)\.git$/ | |
`open "https://github.com/#{$1}"` | |
exit 0 | |
end | |
end | |
exit 1 |