Scroll to navigation

GH-BROWSE(1) GitHub CLI manual GH-BROWSE(1)

NAME

gh-browse - Open the repository in the browser

SYNOPSIS

gh browse [<number> | <path> | <commit-SHA>] [flags]

DESCRIPTION

Open the GitHub repository in the web browser.

OPTIONS

Select another branch by passing in the branch name

Select another commit by passing in the commit SHA, default is the last commit

Print destination URL instead of opening the browser

Open repository projects

Open repository releases

Select another repository using the [HOST/]OWNER/REPO format

Open repository settings

Open repository wiki

EXIT CODES

0: Successful execution

1: Error

2: Command canceled

4: Authentication required

NOTE: Specific commands may have additional exit codes. Refer to the command's help for more information.

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

gh(1)

Oct 2024 GitHub CLI v2.58.0