# Create a pull request

`/{owner}/{repo}/pulls/new` opens a pull request. It is reached from **New
Pull Request** on the [pull request list](https://git.cafe/docs/collaboration/pull-requests.md) and from **New pull
request** on a non-default row of the [branches page](https://git.cafe/docs/repositories/branches.md), which
preselects that branch (`?compare=<branch>`).

## Choose branches and describe the change

- **Source branch** and **Target branch**: searchable branch pickers. The
  target defaults to the repository's default branch; the source picker hides
  the branch chosen as target.
- **Title**: prefilled from the source branch name (`fix-parser` becomes
  `Fix parser`) until edited.
- **Description (optional)**: a Markdown editor with Write/Preview and
  image attachments.
- **Create Pull Request**: enabled once a title, source and target are set.
  Success opens the new pull request.

## Compare preview

With a source and a different target chosen in the same repository, the diff
between them renders under the form. There is no preview for cross-fork pull
requests.

## Opening into the parent

On a fork, **Create pull request on upstream `owner/repo`** switches the
target to the parent repository: the target picker lists the parent's branches
and the pull request is created in the parent with this fork's branch as its
source. The toggle is locked while the description carries an attached image,
because attachments belong to the repository they were uploaded to.

## If creation fails

The server's message appears above the button and the form keeps its values.
If the pull request was created but the description could not be saved, the
message says so and names the number.
