https://github.com/mogensen/go-git-open
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.
https://github.com/mogensen/go-git-open
browser git hacktoberfest
Last synced: 5 months ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/mogensen/go-git-open
- Owner: mogensen
- License: mit
- Created: 2020-08-11T10:59:47.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2021-04-06T19:02:41.000Z (about 5 years ago)
- Last Synced: 2024-06-20T02:12:14.501Z (about 2 years ago)
- Topics: browser, git, hacktoberfest
- Language: Go
- Homepage:
- Size: 64.5 KB
- Stars: 3
- Watchers: 3
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# go-git-open
[](https://actions-badge.atrox.dev/mogensen/go-git-open/goto)
[](https://goreportcard.com/report/github.com/mogensen/go-git-open)
[](https://codecov.io/gh/mogensen/go-git-open)
[](https://app.fossa.com/projects/git%2Bgithub.com%2Fmogensen%2Fgo-git-open?ref=badge_shield)
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.
## Usage
```sh
# Open the page for this branch on the repo website
git open
```
## Installation
### Linux
```bash
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
```
### macOS
```bash
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
```
### Windows
Download the binary from the [Latest Release](https://github.com/mogensen/go-git-open/releases/latest/) and add it to your path.
## Supported remote repositories
`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
## Configuration
```bash
# Overwrite the domain from the git remote url with a specific domain
git config open.domain dev.azure.co
```
## Contributing & Development
### New upstreams
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 in `NewGitURLHandlerWithOverwrite()` and `NewGitURLHandler()`
- Consider adding tests in `internal/gitupstreams/main_test.go`
### Testing
```sh
go test ./...
# and
make test-coverage
```
## Related projects
This project is based on the idea from [paulirish/git-open](https://github.com/paulirish/git-open)
- [`git open`](https://github.com/paulirish/git-open) - Bash base version if this repo
- [`git recent`](https://github.com/paulirish/git-recent) - View your most recent git branches
- [`diff-so-fancy`](https://github.com/so-fancy/diff-so-fancy/) - Making the output of `git diff` so fancy
## License
Licensed under MIT. http://opensource.org/licenses/MIT
[](https://app.fossa.com/projects/git%2Bgithub.com%2Fmogensen%2Fgo-git-open?ref=badge_large)