Git Open

Type git open to open the repo website (GitHub, GitLab, Bitbucket) in your browser

Paul Irish
Jason McCreary
2.8k stars
213 forks

Type git open to open the repo website (GitHub, GitLab, Bitbucket) in your browser.

Demo of git open in action


# Open the page for this branch on the repo website
git open [remote-name] [branch-name]

# Open the current commit in the repo website
git open --commit
git open -c

# If this branch is named like issue/#123, this will open the corresponding
# issue in the repo website
git open --issue
git open -i

# Only print the url at the terminal, but don't open it
git open --print
git open -p

(git open works with these hosted repo providers, git open --issue currently only works with GitHub, Visual Studio Team Services and Team Foundation Server)


$ git open

$ git open someremote

$ git open someremote somebranch

# If branches use naming convention of issues/#123,
# opens https://github.com/TRACKED_REMOTE_USER/CURRENT_REPO/issues/123
$ git open --issue

$ git open --print

# opens https://github.com/TRACKED_REMOTE_USER/CURRENT_REPO/pulls
$ git open --suffix pulls

Supported remote repositories

git-open can automatically guess the corresponding repository page for remotes (default looks for origin) on the following hosts:

  • github.com
  • gist.github.com
  • gitlab.com
  • GitLab custom hosted (see below)
  • bitbucket.org
  • Atlassian Bitbucket Server (formerly Atlassian Stash)
  • Visual Studio Team Services
  • Team Foundation Server (on-premises)
  • AWS Code Commit


See the man page for more information on how to configure git-open.

Alternative projects

See hub for complete GitHub opening support. It's the official GitHub project and provides hub browse.

Homebrew has an alternate git-open that only works with GitHub but can open user profile pages, too.

@gerep has an alternate git-open that works with a few providers. Of note, it opens the default view for BitBucket instead of the source view.

And, of course, jasonmccreary's original gh from which this plugin was forked.


jasonmccreary did the initial hard work. Since then, many contributors have submitted great PRs.

Related projects