git open to open the repo website (GitHub, GitLab, Bitbucket) in your browser.
# 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)
# opens https://github.com/TRACKED_REMOTE_USER/CURRENT_REPO/tree/CURRENT_BRANCH $ git open # opens https://github.com/PROVIDED_REMOTE_USER/CURRENT_REPO/tree/CURRENT_BRANCH $ git open someremote # opens https://github.com/PROVIDED_REMOTE_USER/CURRENT_REPO/tree/PROVIDED_BRANCH $ 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 # prints https://github.com/TRACKED_REMOTE_USER/CURRENT_REPO/tree/CURRENT_BRANCH $ 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:
- GitLab custom hosted (see below)
- 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
See hub for complete GitHub opening support.
It's the official GitHub project and provides
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.