gh repo clone cli/cliClone a repository using OWNER/REPO syntax.
Repository creation, forking, syncing, pull request creation, review, and merge workflows in GitHub CLI.
Create, clone, fork, sync, and inspect repositories.
gh repo clone cli/cliClone a repository using OWNER/REPO syntax.
gh repo clone cli/cli my-cli-copyClone a repository into a named local folder.
gh repo createCreate a new repository with prompts.
Create a repository from the current directory and push initial contents.
gh repo create my-new-repo --public --source=. --remote=origin --pushCreate a repository from the current directory and push initial contents.
gh repo forkFork the current repository.
gh repo fork cli/cli --cloneFork a repo and clone your fork locally.
Set the default repository for future gh commands in this directory.
gh repo set-default my-org/platform-apiSet the default repository for future gh commands in this directory.
gh repo view cli/cliShow repository details.
gh repo edit --description "Internal platform tooling"Update repository metadata.
gh repo edit --homepage "https://docs.example.com"Update the repository homepage URL.
gh repo edit --enable-issuesEnable GitHub Issues for a repository.
gh repo delete my-org/old-repo --yesDelete a repository without interactive confirmation.
gh repo sync my-fork/repoSync a fork with its parent repository.
gh repo archive my-org/legacy-repo --yesArchive a repository.
gh repo unarchive my-org/legacy-repoUnarchive an archived repository.
Create, inspect, and manage pull requests.
gh pr listList open pull requests for the current repo.
gh pr list --state closed --limit 100List pull requests by state.
gh pr view 123Show details for a pull request.
gh pr createCreate a pull request.
gh pr create --fill --base mainAutofill title and body from commits.
gh pr create --title "Add health endpoint" --body "Adds /healthz" --base main --head feature/healthCreate a pull request non-interactively.
gh pr checkout 123Fetch and switch to a pull request locally.
gh pr diff 123Display the diff for a pull request.
gh pr checks 123Display status checks for a pull request.
gh pr statusShow pull requests relevant to you.
gh pr ready 123Mark a draft pull request as ready for review.
gh pr close 123 --comment "Superseded by #456"Close a pull request and optionally leave a comment.
gh pr reopen 123Reopen a closed pull request.
gh pr lock 123 --reason resolvedLock conversation on a pull request.
gh pr unlock 123Unlock a previously locked pull request.
Review, comment, merge, and inspect mergeability.
gh pr review 123 --approveApprove a pull request.
gh pr review 123 --comment --body "Looks good overall."Leave a review comment.
gh pr review 123 --request-changes --body "Please add tests."Request changes during review.
gh pr merge 123 --mergeMerge a pull request using a merge commit.
gh pr merge 123 --squash --delete-branchSquash merge and delete the branch.
gh pr merge 123 --rebaseMerge a pull request using rebase.
gh pr merge 123 --auto --squashEnable auto-merge once checks pass.
Merge bypassing branch protections if you have admin privileges.
gh pr merge 123 --admin --mergeMerge bypassing branch protections if you have admin privileges.
Update a PR branch with the latest base branch changes.
gh pr update-branch 123 --rebaseUpdate a PR branch with the latest base branch changes.
gh pr comment 123 --body "Can you clarify the migration path?"Add a general pull request comment.
gh pr edit 123 --add-label backend --add-reviewer team/backendUpdate title, body, labels, reviewers, or assignees on a PR.
gh pr view 123 --json mergeStateStatus,isDraft,reviewDecisionInspect mergeability and review state programmatically.