git-open

command module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2024 License: MIT Imports: 3 Imported by: 0

README

git-open

git open opens the Git repository in the web browser.

Usage

Open the root of a repository.

$ git open

Open a specific file or folder of a repository.

$ git open LICENSE

Open a specific commit of a repository.

$ git open 7605d91

Open a different repository than cwd.

$ git -C ~/src/my-repo open
Providers

By default, three providers github.com, gitlab.com and bitbucket.org are supported.

To add custom Git providers and their URLs, set their values within the global git config.

[open "https://git.mydomain.dev"]
    commitprefix = commit
    pathprefix = tree

This can also be set using the git CLI.

$ git config --global open.https://git.mydomain.dev.commitprefix commit
$ git config --global open.https://git.mydomain.dev.pathprefix tree

commitprefix and pathprefix are used to template the URI for your provider.

fmt.Println(host + "/" + repository + "/" + commitprefix )
// https://git.mydomain.dev/<repository>/commit

fmt.Println(host + "/" + repository + "/" + pathprefix )
// https://git.mydomain.dev/<repository>/tree

Installation

Install with brew.

$ brew install arbourd/tap/git-open

Install with go install.

$ go install github.com/arbourd/git-open@latest

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL