LinuxCommandLibrary

gh-browse

open repository pages in web browser

TLDR

Open repository in browser

$ gh browse
copy
Open specific file
$ gh browse [path/to/file]
copy
Open at specific line
$ gh browse [path/to/file]:[line]
copy
Open issues page
$ gh browse --issues
copy
Open pull requests page
$ gh browse --pulls
copy
Open specific branch
$ gh browse --branch [branch_name]
copy
Print URL without opening
$ gh browse -n
copy

SYNOPSIS

gh browse [options] [file[:line]]

DESCRIPTION

gh browse opens the GitHub repository in a web browser. It intelligently navigates to specific repository pages, files, and even line numbers based on the arguments provided.
When run in a git repository, it automatically detects the GitHub remote and opens the corresponding page. The command supports opening various repository sections including issues, pull requests, wiki, settings, and releases. It can also navigate to specific files and line numbers, making it easy to share code references with others.
The --no-browser flag allows printing URLs without opening them, useful for scripting and integration with other tools.

PARAMETERS

-b, --branch branch

Select branch.
-n, --no-browser
Print URL only.
-p, --projects
Open projects page.
-r, --releases
Open releases page.
-s, --settings
Open settings page.
-w, --wiki
Open wiki page.
--issues
Open issues page.
--pulls
Open pull requests page.

SEE ALSO

gh(1), gh-repo(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community