LinuxCommandLibrary

gh-repo

Manage GitHub repositories from the command line

TLDR

Clone a repository

$ gh repo clone [owner]/[repo]
copy
Create a new repository
$ gh repo create [name] --public
copy
Fork a repository
$ gh repo fork [owner]/[repo]
copy
View repository
$ gh repo view
copy
List your repositories
$ gh repo list
copy

SYNOPSIS

gh repo command [options]

DESCRIPTION

gh repo manages GitHub repositories from the command line. It provides repository creation, cloning, forking, and management without visiting github.com.
The command supports both HTTPS and SSH cloning based on configuration. Repository creation includes options for visibility, description, license, and gitignore templates. Forking creates linked copies for contribution workflows.

PARAMETERS

clone REPO

Clone a repository locally.
create NAME
Create a new repository.
fork REPO
Fork a repository.
view REPO
View repository details.
list
List accessible repositories.
delete REPO
Delete a repository.
rename NEW-NAME
Rename current repository.
sync
Sync fork with upstream.
--public
Make repository public.
--private
Make repository private.
--help
Display help information.

CAVEATS

Delete requires confirmation. Fork operations need network access. Some operations require owner permissions.

HISTORY

gh repo is a core command in the GitHub CLI, handling repository operations that were previously only available through the web interface or API.

SEE ALSO

gh(1), gh-pr(1), git-clone(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community