gh browse
gh browse [<number> | <path> | <commit-SHA>] [flags]
在网页浏览器中打开 GitHub 仓库。
选项
-b
,--branch <string>
- 通过传递分支名称选择另一个分支
-c
,--commit <string>
- 通过传递提交 SHA 选择另一个提交,默认是最后一次提交
-n
,--no-browser
- 打印目标 URL 而不是打开浏览器
-p
,--projects
- 打开仓库项目
-r
,--releases
- 打开仓库版本
-R
,--repo <[HOST/]OWNER/REPO>
- 使用 [HOST/]OWNER/REPO 格式选择另一个仓库
-s
,--settings
- 打开仓库设置
-w
,--wiki
- 打开仓库 wiki
示例
$ gh browse
#=> Open the home page of the current repository
$ gh browse script/
#=> Open the script directory of the current repository
$ gh browse 217
#=> Open issue or pull request 217
$ gh browse 77507cd94ccafcf568f8560cfecde965fcfa63
#=> Open commit page
$ gh browse --settings
#=> Open repository settings
$ gh browse main.go:312
#=> Open main.go at line 312
$ gh browse main.go --branch bug-fix
#=> Open main.go with the repository at head of bug-fix branch
$ gh browse main.go --commit=77507cd94ccafcf568f8560cfecde965fcfa63
#=> Open main.go with the repository at commit 775007cd