查看原文
其他

GitHub 发布(CLI)命令行工具

GitHub发布命令列工具(Beta)测试版,官方表示,GitHub CLI提供了一种简单无缝的GitHub使用方法。用户可以在macOS、Windows和Linux上安装GitHub CLI,官方会依据使用者的意见反馈,在之后版本添加更多功能。


GitHub CLI提供大家经常使用的基本功能,例如Issue以及Pull Request。大家可以利用GitHub CLI搜寻开源项目并复制(Clone)该储存库,并且能看到由项目维护发布已标注需要帮助标签的问题,然后开发者能直接从GitHub CLI开启浏览器,取得问题的详细信息。

 

开发者可以创建分支,提交修复代码以修复问题所描述的bug,并且创建 pull requests分享贡献。在创建 pull requests 时,GitHub CLI也会在没有分叉时,自动创建分叉推送分支,接着才创建 pull requests 以合并更改。

 

之后开发者也可以利用GitHub CLI快速查看 pull requests 审查的状况,在项目维护者审查了 pull requests,要求进一步修改时,开发者也能快速地在GitHub CLI中,从其他分支切回 pull requests 分支,继续完成未完成的工作。

 

如何使用GitHub CLI?

 

macOS 安装:

安装: 

brew install github/gh/gh

升级:

brew update && brew upgrade gh


Windows 安装:

scoop bucket add github-gh https://github.com/cli/scoop-gh.gitscoop install gh


Debian / Ubuntu Linux 安装:

下载.deb 文件:

版本地址:https://github.com/cli/cli/releases/tag/v0.5.5

安装下载的文件:

sudo yum localinstall gh_*_linux_amd64.rpm 

更多安装说明:

地址:https://github.com/cli/cli#installation-and-upgrading

 

命令用法:

查看命令的详细信息,

使用 

gh [command] [subcommand] --help
gh pr [status, list, view, checkout, create]gh issue [status, list, view, create]gh help

全局标志

--help Show help for command-R, --repo OWNER/REPO Select another repository using the OWNER/REPO format--version Show gh version 

相关文档:

https://cli.github.com/manual/

 

参考:

https://www.ithome.com.tw/news/135803

https://github.blog/2020-02-12-supercharge-your-command-line-experience-github-cli-is-now-in-beta/

https://github.com/cli/cli#installation-and-upgrading



END

Kubernetes  CKA线下班


您可能也对以下帖子感兴趣

文章有问题?点此查看未经处理的缓存