Skip to content

Repository files navigation

gitow icon

CONTRIBUTORS FORKS STARS

CRATES.IO DOWNLOADS

Open Git repository pages from the command line

preview

Tip

Русская версия: README-RU.md

Note

gitow - git open web. A Rust CLI focused on opening repository web pages from the current working tree. It offers:

  • Repository navigation - Open repository roots, branches, commits, issues, pull requests, commit history, releases, tracked files, and custom URL suffixes.
  • Crates.io navigation - Open one or more named packages from any directory, or read the current package name from Cargo, with -x or --crates-io.
  • Remote resolution - Resolve Git remote names, literal remote URLs, insteadOf rewrites, and SSH config aliases.
  • Branch-aware links - Pick the upstream branch, current branch, exact tag, or current commit SHA depending on repository state.
  • Multi-remote workflow - Open named remotes in argument order, or every configured remote with --all-remotes.
  • Script-friendly output - Print generated URLs with --print or BROWSER=echo without launching a browser.
  • Short command surface - Use one compact gitow binary for every navigation target.

Important

Required dependencies:

  • Git
  • Rust 1.88 or newer
  • Platform browser launcher or a BROWSER command

Installation

Install from crates.io

cargo install gitow

This installs the latest published release from crates.io into your Cargo bin directory.

Install with Nix (Flake)

nix run github:WhoSowSee/gitow
nix profile install github:WhoSowSee/gitow

Use nix run to try it without installing, or nix profile install for a persistent install.

Install with Snap (Linux)

Download the .snap package for your architecture from GitHub Releases: amd64 for x86-64 or arm64 for ARM64. With snapd installed, replace ./gitow.snap below with the path to the downloaded file:

sudo snap install --dangerous --classic ./gitow.snap
snap run gitow

--dangerous allows installing the local package without a Snap Store signature; --classic is required for access to repositories and the system browser. Run snap run gitow from your Git working tree.

Install from source

git clone https://github.com/WhoSowSee/gitow.git
cd gitow
cargo install --path .

The command above builds gitow and places the binary into the Cargo bin directory, usually ~/.cargo/bin.

Run locally without installing

cargo build --release
./target/release/gitow --print

Run the binary through Cargo with:

cargo run --bin gitow -- --print

Usage

gitow [OPTIONS] [REMOTE_OR_URL]...

Examples:

gitow
gitow upstream
gitow origin gitlab
gitow git@github.com:owner/repo.git
gitow https://gitlab.example.com/group/project.git --branch main
gitow --repo mdv
gitow -R codeberg/whosowsee/mdv
gitow --print

Navigation targets

  • -c, --commit - opens the current commit in the forge UI.
  • -x, --crates-io [PACKAGE]... - opens the named packages on crates.io, or the current Cargo package when names are omitted.
  • -R, --repo <REPOSITORY>... - opens remote repositories without requiring a local checkout.
  • -i, --issue - opens the issue inferred from the current branch name.
  • -m, --pull-requests - opens the pull requests or merge requests page.
  • -C, --commits - opens the commits page for the selected branch or ref.
  • -r, --releases - opens the releases page where the forge supports it.
  • -a, --all-remotes - opens every configured remote.
  • -b, --branch <BRANCH> - opens the selected branch instead of the current branch or detached ref.
  • -f, --file <PATH> - opens a repository-relative tracked file.
  • -s, --suffix <SUFFIX> - appends an arbitrary suffix to the generated URL.
  • -p, --print - prints the URL instead of launching a browser.
  • -h, --help - shows the help text.
  • -v, --version - shows the program version.

Common workflows

gitow --commit
gitow -x
gitow -x serde clap
gitow --issue
gitow --pull-requests
gitow --commits
gitow --releases
gitow --all-remotes
gitow --file src/main.rs
gitow --suffix actions
gitow --print

Remote repository selection

-R and --repo open one or more remote repositories independently of the current checkout:

gitow -R mdv
gitow -R gitlab/mdv
gitow -R rust-lang/rust
gitow -R codeberg/whosowsee/mdv
gitow --repo gitlab/group/project codeberg/owner/repository

Repository specs are resolved as follows:

  • FORGE/OWNER/REPOSITORY uses a short public forge alias. Supported aliases are github, gitlab, codeberg, bitbucket, gitea, and azure.
  • OWNER/REPOSITORY defaults to GitHub.
  • A full domain, URL, or SSH remote is used directly.
  • A bare REPOSITORY, or FORGE/REPOSITORY, inherits the owner in this order: global Git open.default.owner, local repository open.default.owner, then the owner and forge of the current origin.

Configure the owner with git config --global open.default.owner OWNER, or omit --global for a repository-local value. A bare repository defaults to GitHub when the owner comes from config; an explicit alias such as gitlab/mdv changes the forge. An owner inherited from origin also inherits that remote's forge.

Repository selection supports --pull-requests, --releases, --suffix, and --print. Local-state targets such as --commit, --issue, --commits, --branch, and --file are rejected with --repo.

Remote and branch selection

Explicit remote arguments are opened in the order provided. Every missing named remote is reported to standard error and skipped when at least one other remote resolves successfully. The command fails after reporting every requested remote if none exist.

Without explicit remotes, gitow opens:

  1. open.default.remote, if configured.
  2. origin, if configured.
  3. The current branch's tracked remote, if configured.

Select a branch with -b or --branch. For the ref, gitow uses the selected branch's upstream branch when available, otherwise the selected or current branch. In detached HEAD state, it falls back to an exact tag and then to the current commit SHA.

Supported remote repositories

gitow detects URL layouts for:

  • GitHub
  • GitHub Gist
  • GitLab.com and self-hosted GitLab instances
  • Gitea, Forgejo, Gogs, and Codeberg
  • Bitbucket Cloud
  • Bitbucket Server / Atlassian Stash
  • Azure DevOps / Visual Studio Team Services / Team Foundation Server
  • AWS CodeCommit
  • generic Git hosting URLs

Some pages are forge-specific. Releases are supported for GitHub, GitLab, and Gitea-compatible forges. AWS CodeCommit does not support the issue shortcut.

Configuration

gitow uses normal Git configuration. Add --global to apply an option to all repositories.

Default remote

Set the remote that should be opened when no remote argument is provided:

git config open.default.remote upstream

Custom web domain and protocol

If the Git remote host differs from the web UI host, configure URL-matched overrides:

git config "open.https://git.example.com.domain" "repo.intranet/subpath"
git config "open.https://git.example.com.protocol" "http"

For example, a remote like:

ssh://git@git.example.com:7000/team/repo.git

can open as:

http://repo.intranet/subpath/team/repo

Gitea, Forgejo, and Gogs

Gitea-compatible forges use a different branch URL layout. Codeberg and domains containing gitea, forgejo, or gogs are detected automatically. For custom domains, configure the forge type explicitly:

git config "open.https://git.internal.example.forge" "gitea"

Accepted values gitea, forgejo, and gogs are normalized to gitea.

SSH config aliases

SCP-style remotes can be resolved through SSH config aliases:

Host work
  HostName git.internal.example
git remote set-url origin work:team/repo.git
gitow --print
# prints https://git.internal.example/team/repo

The tool reads the path from the GITOW_SSH_CONFIG environment variable first, then falls back to $HOME/.ssh/config when it exists.

Browser selection and debugging

By default, gitow uses the platform browser launcher:

  • Windows: cmd /C start
  • macOS: open
  • Linux: xdg-open
  • WSL: Windows PowerShell Start

Set BROWSER to use a specific browser command:

BROWSER=firefox gitow

Use --print or BROWSER=echo to inspect generated URLs without opening a browser:

gitow --print
BROWSER=echo gitow

Development

cargo fmt --check
cargo clippy --all-targets -- -D warnings
cargo test

Star History

Stargazers over time

catppuccin

© 2026-present WhoSowSee

LICENSE

About

Open Git remotes and repo pages in your browser from the CLI

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Contributors

Languages