From 84050fbbad855b7f94b0939fea79302d46980efd Mon Sep 17 00:00:00 2001 From: Kynan Ware <47394200+BagToad@users.noreply.github.com> Date: Tue, 24 Mar 2026 09:20:08 -0600 Subject: [PATCH] docs(pr edit): improve command examples with grouped sections Add comment headers to group examples by concern (title/body, labels, reviewers, assignees, projects/milestones), matching the style used by other commands like pr review and repo create. Also adds examples for --body-file and re-requesting review via --add-reviewer. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- pkg/cmd/pr/edit/edit.go | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/pkg/cmd/pr/edit/edit.go b/pkg/cmd/pr/edit/edit.go index 1b40a16f7..08bcd8602 100644 --- a/pkg/cmd/pr/edit/edit.go +++ b/pkg/cmd/pr/edit/edit.go @@ -74,12 +74,31 @@ func NewCmdEdit(f *cmdutil.Factory, runF func(*EditOptions) error) *cobra.Comman - %[1]s@copilot%[1]s: request or remove review from Copilot (not supported on GitHub Enterprise Server) `, "`"), Example: heredoc.Doc(` + # Edit the title and body of a pull request $ gh pr edit 23 --title "I found a bug" --body "Nothing works" + + # Use a file as the body + $ gh pr edit 23 --body-file body.txt + + # Manage labels $ gh pr edit 23 --add-label "bug,help wanted" --remove-label "core" - $ gh pr edit 23 --add-reviewer monalisa,hubot --remove-reviewer myorg/team-name + + # Manage reviewers + $ gh pr edit 23 --add-reviewer monalisa,hubot --remove-reviewer myorg/team-name + + # Re-request review + $ gh pr edit 23 --add-reviewer monalisa + + # Request a review from GitHub Copilot $ gh pr edit 23 --add-reviewer "@copilot" + + # Manage assignees $ gh pr edit 23 --add-assignee "@me" --remove-assignee monalisa,hubot + + # Assign GitHub Copilot $ gh pr edit 23 --add-assignee "@copilot" + + # Manage projects and milestones $ gh pr edit 23 --add-project "Roadmap" --remove-project v1,v2 $ gh pr edit 23 --milestone "Version 1" $ gh pr edit 23 --remove-milestone