gh-browse - Man Page
Open the repository in the browser
Examples (TL;DR)
- Open the homepage of the current repository in the default web browser:
gh browse
- Open the homepage of a specific repository in the default web browser:
gh browse owner/repository
- Open the settings page of the current repository in the default web browser:
gh browse --settings
- Open the wiki of the current repository in the default web browser:
gh browse --wiki
- Open a specific issue or pull request in the web browser:
gh browse issue_number|pull_request_number
- Open a specific branch in the web browser:
gh browse --branch branch_name
- Open a specific file or directory of the current repository in the web browser:
gh browse path/to/file_or_directory
- Print the destination URL without open the web browser:
gh browse --no-browser
Synopsis
gh browse [<number> | <path> | <commit-SHA>] [flags]
Description
Open the GitHub repository in the web browser.
Options
- -b, --branch <string>
Select another branch by passing in the branch name
- -c, --commit <string>
Select another commit by passing in the commit SHA, default is the last commit
- -n, --no-browser
Print destination URL instead of opening the browser
- -p, --projects
Open repository projects
- -r, --releases
Open repository releases
- -R, --repo <[HOST/]OWNER/REPO>
Select another repository using the [HOST/]OWNER/REPO format
- -s, --settings
Open repository settings
- -w, --wiki
Open repository wiki
Example
$ gh browse #=> Open the home page of the current repository $ gh browse script/ #=> Open the script directory of the current repository $ gh browse 217 #=> Open issue or pull request 217 $ gh browse 77507cd94ccafcf568f8560cfecde965fcfa63 #=> Open commit page $ gh browse --settings #=> Open repository settings $ gh browse main.go:312 #=> Open main.go at line 312 $ gh browse main.go --branch bug-fix #=> Open main.go with the repository at head of bug-fix branch $ gh browse main.go --commit=77507cd94ccafcf568f8560cfecde965fcfa63 #=> Open main.go with the repository at commit 775007cd
See Also
Referenced By
Jul 2024 GitHub CLI manual