2020-11-04 18:37:36 +00:00
|
|
|
# gh repo
|
|
|
|
|
2023-07-16 18:23:40 +01:00
|
|
|
> Work with GitHub repositories.
|
2020-11-04 18:37:36 +00:00
|
|
|
> More information: <https://cli.github.com/manual/gh_repo>.
|
|
|
|
|
|
|
|
- Create a new repository (if the repository name is not set, the default name will be the name of the current directory):
|
|
|
|
|
|
|
|
`gh repo create {{name}}`
|
|
|
|
|
|
|
|
- Clone a repository:
|
|
|
|
|
|
|
|
`gh repo clone {{owner}}/{{repository}}`
|
|
|
|
|
|
|
|
- Fork and clone a repository:
|
|
|
|
|
|
|
|
`gh repo fork {{owner}}/{{repository}} --clone`
|
|
|
|
|
2022-05-02 11:55:38 +01:00
|
|
|
- View a repository in the default web browser:
|
2020-11-04 18:37:36 +00:00
|
|
|
|
|
|
|
`gh repo view {{repository}} --web`
|
2021-03-10 14:27:12 +00:00
|
|
|
|
|
|
|
- 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 list {{owner}}`
|
|
|
|
|
|
|
|
- List only non-forks repositories:
|
|
|
|
|
|
|
|
`gh repo list {{owner}} --non-forks`
|
|
|
|
|
|
|
|
- List repositories with a specific primary coding language:
|
|
|
|
|
|
|
|
`gh repo list {{owner}} --language {{language_name}}`
|