Editing a PR
jj pr edit <pr-num|rev> (alias jj pr e) resolves a PR from a PR number or a revision (via its local bookmark), fetches its current state, and opens a markdown file in your editor.
The editor buffer
The buffer is YAML frontmatter followed by the PR body:
---
title: "Add the feature"
base: "master"
labels: ["enhancement"]
reviewers: ["@octocat", "@org/team"]
draft: false
auto_merge: false
auto_merge_method: "merge"
---
PR body goes here.
| Field | Meaning |
|---|---|
title | PR title; required and non-empty. |
base | Base branch; required. Prefilled with the resolved base (owner:branch for cross-fork PRs). |
labels | List of label names. |
reviewers | Collaborator @handles or team @org/team slugs. |
draft | Whether the PR is a draft. |
auto_merge | Enable GitHub auto-merge once required checks pass. |
auto_merge_method | merge, squash, or rebase; omitted unless non-default. |
If a diff preview is enabled, it is appended after a # 8< jj-gh: below this line removed on submit >8 marker. Everything from that marker onward is stripped when the buffer is parsed, so the preview never lands in the PR body.
Only changed metadata is applied
jj-gh compares the edited frontmatter and body with the state fetched before opening the editor. It sends only the fields you changed and applies label and reviewer additions and removals individually, rather than replacing their complete lists. This preserves labels added by CI bots or teammates while you were editing, even though they were not in the original buffer.
The PR URL is printed on success.
An empty body is refused by default to avoid clobbering a body that exists but failed to load; pass -f / --force to override. Title and base must remain non-empty.
Diff preview and editor
--diffs/--no-diffstoggle the read-only diff preview; the defaults are thepr_edit_show_diffs/pr_create_show_diffsconfig settings (bothtrue).- The preview is rendered from local commits when possible, falling back to GitHub’s API.
-e/--editorwins overeditorin config, which wins over jj’sui.editor(jj resolves$JJ_EDITOR,$VISUAL, and$EDITORitself). A common trick iseditor = ["env", "JJ_GH=1", "nvim", "+10"]to detect this flow in your editor config.
See Configuration for the editor and diff settings, and Templates for how the create flow seeds the body.