gh

Work seamlessly with GitHub from the command line.

TLDR

Clone a GitHub repository locally

$ gh repo clone [owner]/[repository]
copy

Create a new issue

$ gh issue create
copy

View and filter the open issues of the current repository

$ gh issue list
copy

View an issue in the default web browser

$ gh issue view --web [issue_number]
copy

Create a pull request

$ gh pr create
copy

View a pull request in the default web browser

$ gh pr view --web [pr_number]
copy

Check out a specific pull request locally

$ gh pr checkout [pr_number]
copy

Check the status of a repository's pull requests

$ gh pr status
copy

SYNOPSIS

gh <command> <subcommand> [flags]

DESCRIPTION

Work seamlessly with GitHub from the command line.

CORE COMMANDS

gh-browse(1)

Open the repository in the browser

gh-codespace(1)

Connect to and manage your codespaces

gh-gist(1)

Manage gists

gh-issue(1)

Manage issues

gh-pr(1)

Manage pull requests

gh-release(1)

Manage GitHub releases

gh-repo(1)

Create, clone, fork, and view repositories

ACTIONS COMMANDS

gh-run(1)

View details about workflow runs

gh-workflow(1)

View details about GitHub Actions workflows

ADDITIONAL COMMANDS

gh-alias(1)

Create command shortcuts

gh-api(1)

Make an authenticated GitHub API request

gh-auth(1)

Login, logout, and refresh your authentication

gh-completion(1)

Generate shell completion scripts

gh-config(1)

Manage configuration for gh

gh-extension(1)

Manage gh extensions

gh-gpg-key(1)

Manage GPG keys

gh-secret(1)

Manage GitHub secrets

gh-ssh-key(1)

Manage SSH keys

OPTIONS

--version

Show gh version

EXAMPLE

$ gh issue create
$ gh repo clone cli/cli
$ gh pr checkout 321

Copied to clipboard
digitalocean