# Gh-Cli - Repositories **Pages:** 72 --- ## gh repo autolink **URL:** https://cli.github.com/manual/gh_repo_autolink **Contents:** - gh repo autolink - Available commands - Options - See also Autolinks link issues, pull requests, commit messages, and release descriptions to external third-party services. Autolinks require admin role to view or manage. For more information, see https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/managing-repository-settings/configuring-autolinks-to-reference-external-resources --- ## gh repo gitignore list **URL:** https://cli.github.com/manual/gh_repo_gitignore_list **Contents:** - gh repo gitignore list - ALIASES - See also List available repository gitignore templates **Examples:** Example 1 (unknown): ```unknown gh repo gitignore list ``` --- ## gh label list **URL:** https://cli.github.com/manual/gh_label_list **Contents:** - gh label list - Options - Options inherited from parent commands - ALIASES - JSON Fields - Examples - See also Display labels in a GitHub repository. When using the --search flag results are sorted by best match of the query. This behavior cannot be configured with the --order or --sort flags. color, createdAt, description, id, isDefault, name, updatedAt, url **Examples:** Example 1 (unknown): ```unknown gh label list [flags] ``` Example 2 (bash): ```bash # Sort labels by name $ gh label list --sort name # Find labels with "bug" in the name or description $ gh label list --search bug ``` --- ## gh repo rename **URL:** https://cli.github.com/manual/gh_repo_rename **Contents:** - gh repo rename - Options - Examples - See also Rename a GitHub repository. is the desired repository name without the owner. By default, the current repository is renamed. Otherwise, the repository specified with --repo is renamed. To transfer repository ownership to another user account or organization, you must follow additional steps on github.com. For more information on transferring repository ownership, see: https://docs.github.com/en/repositories/creating-and-managing-repositories/transferring-a-repository **Examples:** Example 1 (unknown): ```unknown gh repo rename [] [flags] ``` Example 2 (bash): ```bash # Rename the current repository (foo/bar -> foo/baz) $ gh repo rename baz # Rename the specified repository (qux/quux -> qux/baz) $ gh repo rename -R qux/quux baz ``` --- ## gh repo clone **URL:** https://cli.github.com/manual/gh_repo_clone **Contents:** - gh repo clone - Options - Examples - See also - In use - Using OWNER/REPO syntax - Using other selectors Clone a GitHub repository locally. Pass additional git clone flags by listing them after --. If the OWNER/ portion of the OWNER/REPO repository argument is omitted, it defaults to the name of the authenticating user. When a protocol scheme is not provided in the repository argument, the git_protocol will be chosen from your configuration, which can be checked via gh config get git_protocol. If the protocol scheme is provided, the repository will be cloned using the specified protocol. If the repository is a fork, its parent repository will be added as an additional git remote called upstream. The remote name can be configured using --upstream-remote-name. The --upstream-remote-name option supports an @owner value which will name the remote after the owner of the parent repository. If the repository is a fork, its parent repository will be set as the default remote repository. You can clone any repository using OWNER/REPO syntax. You can also use GitHub URLs to clone repositories. **Examples:** Example 1 (unknown): ```unknown gh repo clone [] [-- ...] ``` Example 2 (bash): ```bash # Clone a repository from a specific org $ gh repo clone cli/cli # Clone a repository from your own account $ gh repo clone myrepo # Clone a repo, overriding git protocol configuration $ gh repo clone https://github.com/cli/cli $ gh repo clone git@github.com:cli/cli.git # Clone a repository to a custom directory $ gh repo clone cli/cli workspace/cli # Clone a repository with additional git clone flags $ gh repo clone cli/cli -- --depth=1 ``` Example 3 (unknown): ```unknown # Cloning a repository ~/Projects$ gh repo clone cli/cli Cloning into 'cli'... ~/Projects$ cd cli ~/Projects/cli$ ``` Example 4 (unknown): ```unknown # Cloning a repository ~/Projects/my-project$ gh repo clone https://github.com/cli/cli Cloning into 'cli'... remote: Enumerating objects: 99, done. remote: Counting objects: 100% (99/99), done. remote: Compressing objects: 100% (76/76), done. remote: Total 21160 (delta 49), reused 35 (delta 18), pack-reused 21061 Receiving objects: 100% (21160/21160), 57.93 MiB | 10.82 MiB/s, done. Resolving deltas: 100% (16051/16051), done. ~/Projects/my-project$ ``` --- ## gh repo autolink list **URL:** https://cli.github.com/manual/gh_repo_autolink_list **Contents:** - gh repo autolink list - Options - Options inherited from parent commands - ALIASES - JSON Fields - See also Gets all autolink references that are configured for a repository. Information about autolinks is only available to repository administrators. id, isAlphanumeric, keyPrefix, urlTemplate **Examples:** Example 1 (unknown): ```unknown gh repo autolink list [flags] ``` --- ## gh pr status **URL:** https://cli.github.com/manual/gh_pr_status **Contents:** - gh pr status - Options - Options inherited from parent commands - JSON Fields - See also - In use Show status of relevant pull requests. The status shows a summary of pull requests that includes information such as pull request number, title, CI checks, reviews, etc. To see more details of CI checks, run gh pr checks. additions, assignees, author, autoMergeRequest, baseRefName, baseRefOid, body, changedFiles, closed, closedAt, closingIssuesReferences, comments, commits, createdAt, deletions, files, fullDatabaseId, headRefName, headRefOid, headRepository, headRepositoryOwner, id, isCrossRepository, isDraft, labels, latestReviews, maintainerCanModify, mergeCommit, mergeStateStatus, mergeable, mergedAt, mergedBy, milestone, number, potentialMergeCommit, projectCards, projectItems, reactionGroups, reviewDecision, reviewRequests, reviews, state, statusCheckRollup, title, updatedAt, url **Examples:** Example 1 (unknown): ```unknown gh pr status [flags] ``` Example 2 (unknown): ```unknown # Viewing the status of your relevant pull requests ~/Projects/my-project$ gh pr status Current branch #12 Remove the test feature [user:patch-2] - All checks failing - Review required Created by you You have no open pull requests Requesting a code review from you #13 Fix tests [branch] - 3/4 checks failing - Review required #15 New feature [branch] - Checks passing - Approved ~/Projects/my-project$ ``` --- ## gh agent-task create **URL:** https://cli.github.com/manual/gh_agent-task_create **Contents:** - gh agent-task create - Options - Examples - See also Create an agent task (preview) **Examples:** Example 1 (unknown): ```unknown gh agent-task create [] [flags] ``` Example 2 (bash): ```bash # Create a task from an inline description $ gh agent-task create "build me a new app" # Create a task from an inline description and follow logs $ gh agent-task create "build me a new app" --follow # Create a task from a file $ gh agent-task create -F task-desc.md # Create a task with problem statement from stdin $ echo "build me a new app" | gh agent-task create -F - # Create a task with an editor $ gh agent-task create # Create a task with an editor and a file as a template $ gh agent-task create -F task-desc.md # Select a different base branch for the PR $ gh agent-task create "fix errors" --base branch ``` --- ## gh project unlink **URL:** https://cli.github.com/manual/gh_project_unlink **Contents:** - gh project unlink - Options - Examples - See also Unlink a project from a repository or a team **Examples:** Example 1 (unknown): ```unknown gh project unlink [] [flags] ``` Example 2 (bash): ```bash # Unlink monalisa's project 1 from her repository "my_repo" $ gh project unlink 1 --owner monalisa --repo my_repo # Unlink monalisa's organization's project 1 from her team "my_team" $ gh project unlink 1 --owner my_organization --team my_team # Unlink monalisa's project 1 from the repository of current directory if neither --repo nor --team is specified $ gh project unlink 1 ``` --- ## gh repo **URL:** https://cli.github.com/manual/gh_repo **Contents:** - gh repo - General commands - Targeted commands - Examples - See also Work with GitHub repositories. **Examples:** Example 1 (bash): ```bash $ gh repo create $ gh repo clone cli/cli $ gh repo view --web ``` --- ## gh project link **URL:** https://cli.github.com/manual/gh_project_link **Contents:** - gh project link - Options - Examples - See also Link a project to a repository or a team **Examples:** Example 1 (unknown): ```unknown gh project link [] [flags] ``` Example 2 (bash): ```bash # Link monalisa's project 1 to her repository "my_repo" $ gh project link 1 --owner monalisa --repo my_repo # Link monalisa's organization's project 1 to her team "my_team" $ gh project link 1 --owner my_organization --team my_team # Link monalisa's project 1 to the repository of current directory if neither --repo nor --team is specified $ gh project link 1 ``` --- ## gh repo autolink view **URL:** https://cli.github.com/manual/gh_repo_autolink_view **Contents:** - gh repo autolink view - Options - Options inherited from parent commands - JSON Fields - See also View an autolink reference for a repository. id, isAlphanumeric, keyPrefix, urlTemplate **Examples:** Example 1 (unknown): ```unknown gh repo autolink view [flags] ``` --- ## gh label clone **URL:** https://cli.github.com/manual/gh_label_clone **Contents:** - gh label clone - Options - Options inherited from parent commands - Examples - See also Clones labels from a source repository to a destination repository on GitHub. By default, the destination repository is the current repository. All labels from the source repository will be copied to the destination repository. Labels in the destination repository that are not in the source repository will not be deleted or modified. Labels from the source repository that already exist in the destination repository will be skipped. You can overwrite existing labels in the destination repository using the --force flag. **Examples:** Example 1 (unknown): ```unknown gh label clone [flags] ``` Example 2 (bash): ```bash # Clone and overwrite labels from cli/cli repository into the current repository $ gh label clone cli/cli --force # Clone labels from cli/cli repository into a octocat/cli repository $ gh label clone cli/cli --repo octocat/cli ``` --- ## gh repo list **URL:** https://cli.github.com/manual/gh_repo_list **Contents:** - gh repo list - Options - ALIASES - JSON Fields - See also List repositories owned by a user or organization. Note that the list will only include repositories owned by the provided argument, and the --fork or --source flags will not traverse ownership boundaries. For example, when listing the forks in an organization, the output would not include those owned by individual users. archivedAt, 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 **Examples:** Example 1 (unknown): ```unknown gh repo list [] [flags] ``` --- ## gh issue unpin **URL:** https://cli.github.com/manual/gh_issue_unpin **Contents:** - gh issue unpin - Options inherited from parent commands - Examples - See also Unpin an issue from a repository. The issue can be specified by issue number or URL. **Examples:** Example 1 (unknown): ```unknown gh issue unpin { | } ``` Example 2 (bash): ```bash # Unpin issue from the current repository $ gh issue unpin 23 # Unpin issue by URL $ gh issue unpin https://github.com/owner/repo/issues/23 # Unpin an issue from specific repository $ gh issue unpin 23 --repo owner/repo ``` --- ## gh repo view **URL:** https://cli.github.com/manual/gh_repo_view **Contents:** - gh repo view - Options - JSON Fields - See also - In use - In terminal - In the browser - With no arguments Display the description and the README of a GitHub repository. With no argument, the repository for the current directory is displayed. With --web, open the repository in a web browser instead. With --branch, view a specific branch of the repository. archivedAt, 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 By default, we will display items in the terminal. Quickly open an item in the browser using --web or -w We will display the repository you're currently in. **Examples:** Example 1 (unknown): ```unknown gh repo view [] [flags] ``` Example 2 (unknown): ```unknown # 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$ ``` Example 3 (unknown): ```unknown # Viewing a repository in the browser ~/Projects$ gh repo view owner/repo --web Opening https://github.com/owner/repo/ in your browser. ~/Projects$ ``` Example 4 (unknown): ```unknown # 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$ ``` --- ## gh gist clone **URL:** https://cli.github.com/manual/gh_gist_clone **Contents:** - gh gist clone - See also Clone a GitHub gist locally. A gist can be supplied as argument in either of the following formats: Pass additional git clone flags by listing them after --. **Examples:** Example 1 (unknown): ```unknown gh gist clone [] [-- ...] ``` --- ## gh codespace create **URL:** https://cli.github.com/manual/gh_codespace_create **Contents:** - gh codespace create - Options - See also **Examples:** Example 1 (unknown): ```unknown gh codespace create [flags] ``` --- ## gh repo delete **URL:** https://cli.github.com/manual/gh_repo_delete **Contents:** - gh repo delete - Options - See also Delete a GitHub repository. With no argument, deletes the current repository. Otherwise, deletes the specified repository. For safety, when no repository argument is provided, the --yes flag is ignored and you will be prompted for confirmation. To delete the current repository non-interactively, specify it explicitly (e.g., gh repo delete owner/repo --yes). Deletion requires authorization with the delete_repo scope. To authorize, run gh auth refresh -s delete_repo **Examples:** Example 1 (unknown): ```unknown gh repo delete [] [flags] ``` --- ## gh repo deploy-key add **URL:** https://cli.github.com/manual/gh_repo_deploy-key_add **Contents:** - gh repo deploy-key add - Options - Options inherited from parent commands - Examples - See also Add a deploy key to a GitHub repository. Note that any key added by gh will be associated with the current authentication token. If you de-authorize the GitHub CLI app or authentication token from your account, any deploy keys added by GitHub CLI will be removed as well. **Examples:** Example 1 (unknown): ```unknown gh repo deploy-key add [flags] ``` Example 2 (bash): ```bash # Generate a passwordless SSH key and add it as a deploy key to a repository $ ssh-keygen -t ed25519 -C "my description" -N "" -f ~/.ssh/gh-test $ gh repo deploy-key add ~/.ssh/gh-test.pub ``` --- ## gh repo gitignore view **URL:** https://cli.github.com/manual/gh_repo_gitignore_view **Contents:** - gh repo gitignore view - Examples - See also View an available repository .gitignore template.