Parzh from Ukraine
Parzh from Ukraine

Reputation: 9903

Can I set default repository for pull requests from fork?

I have a fork of an old, not-very-well-supported repository. In the fork, whenever I create a pull request from feature branch to master (i.e. the default branch), I have to specify base repository manually, every single time:

specify PR base repository manually

There's a similar issue with BitBucket; it has a well description, but the answers are out of scope for this one.

Can I change this behavior of GitHub UI somehow, so that new pull requests are created against specific repository?


I assume that I can achieve this by de-forking the repo, but I'd like to keep the fork relation a) due to historical reasons, b) out of respect to the original author, and c) because this is a highly error-prone process for now (there's no single button for that, unfortunately)

Upvotes: 13

Views: 1458

Answers (1)

VonC
VonC

Reputation: 1326832

While changing the base branch of an existing PR is supported, changing the actual upstream repository is not for now (Q1 2022)

I would:

  • make a new fork of the target upstream repository
  • change origin of my local repository to that new fork and push my PR branches to it
  • make new PR from that new fork: this tie, the base repository is the right one every time.
  • possibly push the same feature branch to my old fork, which remains tied to the old upstream repository

Upvotes: 1

Related Questions