Skip to content

Ability to edit title/body/metadata of already open PR #1349

@GMNGeoffrey

Description

@GMNGeoffrey

Describe the feature or problem you’d like to solve

I'd like to be able to edit a PR I already have open. Obviously editing the commits is just a matter of git push, but I'd like to be able to edit the PR title and body as well.

Potential solutions:

  1. gh pr edit 1234 gives prompts similar to gh pr create but only for the title and body. Users could separately push their branch to update the commits.
  2. gh pr edit looks for a PR from the current branch and edits it with the current commits and specified title and body.
  3. gh pr edit 1234 pushes commits from the current branch if they match the PR branch and allows editing the title and body.
  4. gh pr create --overwrite acts exactly like gh pr create, but instead of getting an error like a pull request for branch "GMNGeoffrey:foo" into branch "main" already exists: overwrites that PR with the specified configuration.

I think I like the combination of 1 & 4. It seems weird to have create be the only way to edit a PR, but it might also be annoying to have to separately push to the branch or to know a-priori whether a PR already exists. 2 & 3 seem a bit too magic to me.

This gives the ability to fixup already-sent PRs without having to close and create a new one or break out of the CLI.

Metadata

Metadata

Assignees

Labels

coreThis issue is not accepting PRs from outside contributorsenhancementa request to improve CLI

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions