gh repo view

gh repo view [<repository>] [flags]

显示 GitHub 仓库的描述和自述文件。

没有参数,将显示当前目录的仓库。

使用 `--web`,在网络浏览器中打开仓库。

使用 `--branch`,查看仓库的特定分支。

选项

-b, --branch <string>
查看仓库的特定分支
-q, --jq <expression>
使用 jq 表达式过滤 JSON 输出
--json <fields>
使用指定的字段输出 JSON
-t, --template <string>
使用 Go 模板格式化 JSON 输出;请参阅“gh help formatting”。
-w, --web
在浏览器中打开仓库

JSON 字段

assignableUsers, codeOfConduct, contactLinks, createdAt, defaultBranchRef, deleteBranchOnMerge, description, diskUsage, forkCount, fundingLinks, hasDiscussionsEnabled, hasIssuesEnabled, hasProjectsEnabled, hasWikiEnabled, homepageUrl, id, isArchived, isBlankIssuesEnabled, isEmpty, isFork, isInOrganization, isMirror, isPrivate, isSecurityPolicyEnabled, isTemplate, isUserConfigurationRepository, issueTemplates, issues, labels, languages, latestRelease, licenseInfo, mentionableUsers, mergeCommitAllowed, milestones, mirrorUrl, name, nameWithOwner, openGraphImageUrl, owner, parent, primaryLanguage, projects, projectsV2, pullRequestTemplates, pullRequests, pushedAt, rebaseMergeAllowed, repositoryTopics, securityPolicyUrl, squashMergeAllowed, sshUrl, stargazerCount, templateRepository, updatedAt, url, usesCustomOpenGraphImage, viewerCanAdminister, viewerDefaultCommitEmail, viewerDefaultMergeMethod, viewerHasStarred, viewerPermission, viewerPossibleCommitEmails, viewerSubscription, visibility, watchers

另请参阅

正在使用

在终端

默认情况下,我们将显示终端中的项目。

# Viewing a repository in terminal
~/Projects/my-project$ gh repo view owner/repo
owner/repo
Repository description

  Repository README

View this repository on GitHub: https://github.com/owner/repo/
~/Projects/my-project$

在浏览器

使用 `--web` 或 `-w` 快速在浏览器中打开项目

# Viewing a repository in the browser
~/Projects$ gh repo view owner/repo --web
Opening https://github.com/owner/repo/ in your browser.
~/Projects$

没有参数

我们将显示您当前所在的仓库。

# Viewing the repository you're in
~/Projects/my-project$ gh repo view
owner/my-project
Repository description

  Repository README

View this repository on GitHub: https://github.com/owner/repo/
~/Projects/my-project$