gh技能使用说明

subsun 5个月前 (03-29) openclaw小龙虾 224 0

GitHub CLI (gh)

概述

使用gh用于在终端中执行经过身份验证的GitHub操作。偏好使用明确、幂等的命令,并将URL报告给用户。

快速检查

  • 认证状态:
gh auth status
  • 当前仓库上下文:
gh repo view --json nameWithOwner,url,defaultBranchRef

核心工作流

仓库创建(默认私有)

gh repo create OWNER/NAME --private --confirm --description "..."

如果在本地仓库内运行,请使用--source . --remote origin --push

克隆 / 复刻

gh repo clone OWNER/NAME
gh repo fork OWNER/NAME --clone

议题

  • 列表:
gh issue list --limit 20
  • 创建:
gh issue create --title "..." --body "..."
  • 评论:
gh issue comment <num> --body "..."

拉取请求

  • 从当前分支创建:
gh pr create --title "..." --body "..."
  • 列表:
gh pr list --limit 20
  • 查看:
gh pr view <num> --web
  • 合并(使用明确的方法):
gh pr merge <num> --merge

发布

gh release create vX.Y.Z --title "vX.Y.Z" --notes "..."

安全注意事项

  • 在执行破坏性操作(删除、强制推送)前,请确认目标仓库/所有者。
  • 对于私有仓库,请确保在创建时设置--private参数。
  • 在自动化流程中,建议使用--confirm参数以避免交互式提示。
免责申明
部分文章来自各大搜索引擎,如有侵权,请与我联系删除。
打赏

相关推荐

网友评论

  • (*)

最新评论

用户管理

您好,欢迎到访网站!
    用户注册

您是本站第1624458名访客 今日有0篇新文章/评论