跳至正文
Wener Notes

gh

约 1 分钟阅读
标签:命令行
  • cli.github.com/manual/examples

尽量使用 PAT classic,以用户身份,fine-grained 限定 resource owner 不能同时支持操作多个组织。

bash
# in server auth by PAT
cat token.txt | gh auth login --with-token --skip-ssh-key --insecure-storage --git-protocol https

gh auth status

gh repo clone owner/repo
gh repo create <repo-name> --public
gh repo list <username> --limit 10

gh pr create --base main --head feature-branch --title "My PR title" --body "PR description"
gh pr list
gh pr checkout <pr-number>
gh pr merge <pr-number>

gh issue list
gh issue view <issue-number>

gh issue create --title "Issue title" --body "Issue body"
gh notification list

gh workflow list
gh workflow run <workflow-id or name>

use gh as git credential helper

bash
gh auth setup-git
~/.gitconfig
[credential "https://github.com"]
        helper =
        helper = !/usr/bin/gh auth git-credential
[credential "https://gist.github.com"]
        helper =
        helper = !/usr/bin/gh auth git-credential

关联信息

反向链接、本文链接的其他页面和外部资料。

参考资料

GitHub1 条
其他外链1 条
最近更新commit a27d092编辑