gh-repo

Manage GitHub repositories from the command line

TLDR

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

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.

INSTALL

sudo apt install gh
sudo dnf install gh
sudo pacman -S github-cli
sudo apk add github-cli
sudo zypper install gh
brew install gh
nix profile install nixpkgs#gh

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)

RESOURCES

Documentation · Source code