HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

gh repo — Work with GitHub repositories. More information: <https://cli.github.com/manual/gh_repo>.

Submitted by: @import:tldr-pages··
0
Viewed 0 times
repositoriescommandgithubcliwithmoreworkgh repo

Problem

How to use the gh repo command: Work with GitHub repositories. More information: <https://cli.github.com/manual/gh_repo>.

Solution

gh repo — Work with GitHub repositories. More information: <https://cli.github.com/manual/gh_repo>.

Create a new repository interactively:
gh repo {{[new|create]}}


Clone a repository:
gh repo clone {{owner}}/{{repository}}


Fork and clone a repository:
gh repo fork {{owner}}/{{repository}} --clone


View a repository in the default web browser:
gh repo view {{repository}} {{[-w|--web]}}


List repositories owned by a specific user or organization (if the owner is not set, the default owner will be the currently logged in user):
gh repo {{[ls|list]}} {{owner}}


List only non-forks repositories and limit the number of repositories to list (default: 30):
gh repo {{[ls|list]}} {{owner}} --source {{[-L|--limit]}} {{limit}}


List repositories with a specific primary coding language:
gh repo {{[ls|list]}} {{owner}} {{[-l|--language]}} {{language_name}}

Code Snippets

Create a new repository interactively

gh repo {{[new|create]}}

Clone a repository

gh repo clone {{owner}}/{{repository}}

Fork and clone a repository

gh repo fork {{owner}}/{{repository}} --clone

View a repository in the default web browser

gh repo view {{repository}} {{[-w|--web]}}

List repositories owned by a specific user or organization (if the owner is not set, the default owner will be the currently logged in user)

gh repo {{[ls|list]}} {{owner}}

Context

tldr-pages: common/gh repo

Revisions (0)

No revisions yet.