GIT-OPEN(1)
π git-open(1) π
Bestie, this is the git-open page from the Git manual, version 3.1.0 β and itβs literally here to open your repoβs website in your browser. π β¨
πΈ NAME πΈ
git-open β Open the repositoryβs website in your browser.
β¨ SYNOPSIS β¨
git open [βissue] [βcommit] [βsuffix some_suffix] [remote-name] [branch-name]
π DESCRIPTION π
git open opens the repositoryβs website in your browser. The major well known git hosting services are supported. π«Ά
π¦ OPTIONS π¦
-c,--commitβ Open the current commit. See EXAMPLES for more information. Only tested with GitHub & GitLab.-i,--issueβ Open the current issue. When the name of the current branch matches the right pattern, it will open the webpage with that issue. See EXAMPLES for more information. This only works on GitHub, GitLab, Visual Studio Team Services and Team Foundation Server at the moment.-s,--suffixsome_suffix β Append the given suffix to the url.-p,--printβ Just print the URL. Do not open it in browser.-hβ Show a short help text.
π EXAMPLES π
Okay so, examples time β this is where it all clicks. β¨
git open
It opens https://github.com/TRACKED_REMOTE_USER/CURRENT_REPO/
git open someremote
It opens https://github.com/PROVIDED_REMOTE_USER/CURRENT_REPO/
git open someremote somebranch
It opens https://github.com/PROVIDED_REMOTE_USER/CURRENT_REPO/tree/PROVIDED_BRANCH
git open --issue
If branches use naming convention of issues/#123, it opens https://github.com/TRACKED_REMOTE_USER/CURRENT_REPO/issues/123
git open --suffix pulls
It opens the URL https://github.com/TRACKED_REMOTE_USER/CURRENT_REPO/pulls
git open --print
It prints the URL https://github.com/TRACKED_REMOTE_USER/CURRENT_REPO/
git open --commit
Supposing that the current sha is 2ddc8d4548d0cee3d714dcf0068dbec5b168a9b2, it opens https://github.com/TRACKED_REMOTE_USER/CURRENT_REPO/commit/2ddc8d4548d0cee3d714dcf0068dbec5b168a9b2
π SUPPORTED GIT HOSTING SERVICES π
git-open can automatically guess the corresponding repository page for remotes on the following git hosting services:
github.comgist.github.comgitlab.com- GitLab CE/EE (self hosted GitLab, see CONFIGURATION)
bitbucket.org- Atlassian Bitbucket Server (formerly Atlassian Stash)
- Visual Studio Team Services
- Team Foundation Server (on-premises)
π CONFIGURATION π
To configure git-open you may need to set some git config options. You can use --global to set across all repos, instead of just the current repo.
git config [--global] option value
πΏ Configuring which remote to open πΏ
By default, git open opens the remote named origin. However, if your current branch is remotely-tracking a different remote, that tracked remote will be used.
In some instances, you may want to override this behavior. When you fork a project and add a remote named upstream you often want that upstream to be opened rather than your fork. To accomplish this, you can set the open.default.remote within your project:
git config open.default.remote upstream
This is equivalent to always typing git open upstream.
π Gitea options π
To configure Gitea support you need to set the following option.
open.[gitdomain].forge The git forge present at the git domain. This only needs to be set for Gitea because it uses another branch URL format.
β¨ Example β¨
git config [--global] "open.https://gitea.internal.biz.forge" "gitea"
π§ GitLab options π§
To configure GitLab support (or other unique hosting situations) you may need to set some options.
open.[gitdomain].domain The (web) domain to open based on the provided git repo domain.
open.[gitdomain].protocol The (web) protocol to open based on the provided git repo domain. Defaults to https.
git config [--global] open.[gitdomain].domain [value]
git config [--global] open.[gitdomain].protocol [value]
π Example π
- Your git remote is at
ssh://git@git.internal.biz:7000/XXX/YYY.git - Your hosted gitlab is
http://repo.intranet/subpath/XXX/YYY
git config [--global] "open.https://git.internal.biz.domain" "repo.intranet/subpath"
git config [--global] "open.https://git.internal.biz.protocol" "http"
π₯ DEBUGGING π₯
You can run git-open in echo mode, which doesnβt open your browser, but just prints the URL to stdout:
env BROWSER='echo' ./git-open
π AUTHORS π
Jason McCreary did the initial hard work. Paul Irish based his project on his work. Since then many contributors have submitted great PRs.
β SEE ALSO β
git(1)git-remote(1)git-config(1)- Project page
π Thatβs the whole manual, bestie β Source/version: Git manual, git-open 3.1.0 Β· Date: not printed in this copy. π«Ά
π¦ where this page comes from
- nixos 26.05: git-open 3.1.0
- nixpkgs unstable: git-open 3.1.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms