gh repo create
gh repo create [<name>] [flags]
创建新的 GitHub 仓库。
要以交互方式创建仓库,请使用 gh repo create 不带任何参数。
要以非交互方式创建远程仓库,请提供仓库名称以及 --public、--private 或 --internal 之一。传递 --clone 以在本地克隆新仓库。
If the `OWNER/` portion of the `OWNER/REPO` name argument is omitted, it defaults to the name of the authenticating user.
要从现有本地仓库创建远程仓库,请使用 --source 指定源目录。默认情况下,远程仓库名称将是源目录的名称。传递 --push 以将任何本地提交推送到新仓库。
选项
-
--add-readme - 将 README 文件添加到新仓库
-c,--clone- 将新仓库克隆到当前目录
-d,--description <string>- 仓库描述
-
--disable-issues - 在新的仓库中禁用问题
-
--disable-wiki - 在新的仓库中禁用 wiki
-g,--gitignore <string>- 为仓库指定 gitignore 模板
-h,--homepage <URL>- 仓库主页 URL
-
--include-all-branches - 包含模板仓库中的所有分支
-
--internal - 将新的仓库设为内部仓库
-l,--license <string>- 为仓库指定开源许可证
-
--private - 将新的仓库设为私有仓库
-
--public - 将新的仓库设为公开仓库
-
--push - 将本地提交推送到新仓库
-r,--remote <string>- 为新仓库指定远程名称
-s,--source <string>- 指定要用作源的本地仓库的路径
-t,--team <name>- 要授予访问权限的组织团队的名称
-p,--template <repository>- 根据模板仓库创建新的仓库
别名
gh repo new
示例
# create a repository interactively
gh repo create
# create a new remote repository and clone it locally
gh repo create my-project --public --clone
# create a new remote repository in a different organization
gh repo create my-org/my-project --public
# create a remote repository from the current directory
gh repo create my-project --private --source=. --remote=upstream