跳到主要内容

GitHub CLI 速查表

GitHub CLI 让你在终端中完成所有 GitHub 操作:克隆、创建 PR、审核代码、管理 Issue、触发 Actions。

更新: 2026-07-20·21 条命令

快速开始

``bash gh auth login gh repo create my-project --public gh pr create --fill gh pr list --state open gh run list --limit 5 ``

启动模式(21)

命令难度
gh --help
显示 gh 帮助
基础
gh auth login
登录 GitHub 账号
基础
gh auth status
查看登录状态
基础
gh repo clone
克隆仓库到本地
基础
gh repo create
创建新仓库(本地+远程)
基础
gh repo fork
Fork 一个仓库
基础
gh pr create
创建 Pull Request
基础
gh pr list
列出 Pull Request
基础
gh pr checkout
切换到 PR 的本地分支
基础
gh pr review
提交 PR 审核
中级
gh pr merge
合并 PR
中级
gh issue list
列出 Issue
基础
gh issue create
创建 Issue
基础
gh issue close
关闭 Issue
基础
gh run list
列出 Actions 工作流运行
中级
gh run watch
实时查看 Actions 运行日志
中级
gh release list
列出发布版本
基础
gh release download
下载发布版本中的资源
中级
gh gist create
创建 Gist
基础
gh search repos
搜索仓库
中级
gh config set
设置 git 配置项
中级
本速查表数据整理自各工具官方文档。最后更新: 2026-07-20。