2025-07-24 22:27:13 -06:00
|
|
|
# gh repo create
|
|
|
|
|
|
|
|
|
|
> Create a new GitHub repository.
|
2025-12-16 10:20:31 -07:00
|
|
|
> Note: `--public`, `--private`, or `--internal` is required when not running interactively.
|
2025-07-24 22:27:13 -06:00
|
|
|
> More information: <https://cli.github.com/manual/gh_repo_create>.
|
|
|
|
|
|
|
|
|
|
- Create a new repository interactively:
|
|
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
`gh repo {{[new|create]}}`
|
2025-07-24 22:27:13 -06:00
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
- Create a private repository from the current directory:
|
2025-07-24 22:27:13 -06:00
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
`gh repo {{[new|create]}} {{[-s|--source]}} . --private`
|
2025-07-24 22:27:13 -06:00
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
- Create a public repository from the current directory:
|
2025-07-24 22:27:13 -06:00
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
`gh repo {{[new|create]}} {{[-s|--source]}} . --public`
|
2025-07-24 22:27:13 -06:00
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
- Create a public repository with a specified name and description:
|
2025-07-24 22:27:13 -06:00
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
`gh repo {{[new|create]}} {{repo_name}} {{[-d|--description]}} "{{repo_description}}" --public`
|
2025-07-24 22:27:13 -06:00
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
- Clone the new repository locally after creation:
|
2025-07-24 22:27:13 -06:00
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
`gh repo {{[new|create]}} {{repo_name}} {{[-c|--clone]}} {{--public|--private|--internal}}`
|