This is an extension for the git
cli, that allows you to open any git repository in your browser.
Just type git open
to open the repo website.
# Open the page for this branch on the repo website
git open
curl -Lo /tmp/git-open.tar.gz https://github.com/mogensen/go-git-open/releases/download/v0.0.1/git-open_Linux_x86_64.tar.gz
tar xzvf /tmp/git-open.tar.gz -C /tmp
chmod +x /tmp/git-open
sudo mv /tmp/git-open /usr/local/bin
curl -Lo /tmp/git-open.tar.gz https://github.com/mogensen/go-git-open/releases/download/v0.0.1/git-open_Darwin_x86_64.tar.gz
tar xzvf /tmp/git-open.tar.gz -C /tmp
chmod +x /tmp/git-open
sudo mv /tmp/git-open /usr/local/bin
Download the binary from the Latest Release and add it to your path.
go-git-open
can create correct browser urls for a range of different git repository providers.
The currently tested ones are:
- github.com
- gist.github.com
- bitbucket.org
- bitbucket - Selfhosted
- Azure DevOps
- gitlab.com
# Overwrite the domain from the git remote url with a specific domain
git config open.domain dev.azure.co
Adding new upstreams are welcome!
Check list:
- Add
internal/gitupstreams/mygit.go
with the implementation of how to create the urls - Add
internal/gitupstreams/mygit_test.go
containing tests for the upstream implementation - Add the new upstream in
internal/gitupstreams/main.go
both inNewGitURLHandlerWithOverwrite()
andNewGitURLHandler()
- Consider adding tests in
internal/gitupstreams/main_test.go
go test ./...
# and
make test-coverage
This project is based on the idea from paulirish/git-open
git open
- Bash base version if this repogit recent
- View your most recent git branchesdiff-so-fancy
- Making the output ofgit diff
so fancy
Licensed under MIT. http://opensource.org/licenses/MIT